Package wof :: Module WaterML
[hide private]
[frames] | no frames]

Source Code for Module wof.WaterML

   1  #!/usr/bin/env python 
   2  # -*- coding: utf-8 -*-  
   3   
   4  # 
   5  # Generated Tue Feb 15 14:13:42 2011 by generateDS.py version 2.3b. 
   6  # 
   7   
   8  import sys 
   9  import getopt 
  10  import re as re_ 
  11   
  12  etree_ = None 
  13  Verbose_import_ = False 
  14  (   XMLParser_import_none, XMLParser_import_lxml, 
  15      XMLParser_import_elementtree 
  16      ) = range(3) 
  17  XMLParser_import_library = None 
  18  try: 
  19      # lxml 
  20      from lxml import etree as etree_ 
  21      XMLParser_import_library = XMLParser_import_lxml 
  22      if Verbose_import_: 
  23          print("running with lxml.etree") 
  24  except ImportError: 
  25      try: 
  26          # cElementTree from Python 2.5+ 
  27          import xml.etree.cElementTree as etree_ 
  28          XMLParser_import_library = XMLParser_import_elementtree 
  29          if Verbose_import_: 
  30              print("running with cElementTree on Python 2.5+") 
  31      except ImportError: 
  32          try: 
  33              # ElementTree from Python 2.5+ 
  34              import xml.etree.ElementTree as etree_ 
  35              XMLParser_import_library = XMLParser_import_elementtree 
  36              if Verbose_import_: 
  37                  print("running with ElementTree on Python 2.5+") 
  38          except ImportError: 
  39              try: 
  40                  # normal cElementTree install 
  41                  import cElementTree as etree_ 
  42                  XMLParser_import_library = XMLParser_import_elementtree 
  43                  if Verbose_import_: 
  44                      print("running with cElementTree") 
  45              except ImportError: 
  46                  try: 
  47                      # normal ElementTree install 
  48                      import elementtree.ElementTree as etree_ 
  49                      XMLParser_import_library = XMLParser_import_elementtree 
  50                      if Verbose_import_: 
  51                          print("running with ElementTree") 
  52                  except ImportError: 
  53                      raise ImportError("Failed to import ElementTree from any known place") 
  54   
  55   
56 -class GeneratedsSuper(object):
57 - def gds_format_string(self, input_data, input_name=''):
58 return input_data
59 - def gds_format_integer(self, input_data, input_name=''):
60 return '%d' % input_data
61 - def gds_format_float(self, input_data, input_name=''):
62 return "{0}".format(input_data)
63 - def gds_format_double(self, input_data, input_name=''):
64 return "{0}".format(input_data)
65 - def gds_format_boolean(self, input_data, input_name=''):
66 return '%s' % input_data
67 - def gds_str_lower(self, instring):
68 return instring.lower()
69 70 # 71 # Globals 72 # 73 74 ExternalEncoding = 'ascii' 75 Tag_pattern_ = re_.compile(r'({.*})?(.*)') 76 STRING_CLEANUP_PAT = re_.compile(r"[\n\r\s]+") 77 78 # 79 # Support/utility functions. 80 # 81
82 -def showIndent(outfile, level):
83 for idx in range(level): 84 outfile.write(' ')
85
86 -def quote_xml(inStr):
87 if not inStr: 88 return '' 89 s1 = (isinstance(inStr, basestring) and inStr or 90 '%s' % inStr) 91 s1 = s1.replace('&', '&amp;') 92 s1 = s1.replace('<', '&lt;') 93 s1 = s1.replace('>', '&gt;') 94 return s1
95
96 -def quote_attrib(inStr):
97 s1 = (isinstance(inStr, basestring) and inStr or 98 '%s' % inStr) 99 s1 = s1.replace('&', '&amp;') 100 s1 = s1.replace('<', '&lt;') 101 s1 = s1.replace('>', '&gt;') 102 if '"' in s1: 103 if "'" in s1: 104 s1 = '"%s"' % s1.replace('"', "&quot;") 105 else: 106 s1 = "'%s'" % s1 107 else: 108 s1 = '"%s"' % s1 109 return s1
110
111 -def quote_python(inStr):
112 s1 = inStr 113 if s1.find("'") == -1: 114 if s1.find('\n') == -1: 115 return "'%s'" % s1 116 else: 117 return "'''%s'''" % s1 118 else: 119 if s1.find('"') != -1: 120 s1 = s1.replace('"', '\\"') 121 if s1.find('\n') == -1: 122 return '"%s"' % s1 123 else: 124 return '"""%s"""' % s1
125 126
127 -def get_all_text_(node):
128 if node.text is not None: 129 text = node.text 130 else: 131 text = '' 132 for child in node: 133 if child.tail is not None: 134 text += child.tail 135 return text
136 137
138 -class GDSParseError(Exception):
139 pass
140
141 -def raise_parse_error(node, msg):
142 if XMLParser_import_library == XMLParser_import_lxml: 143 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) 144 else: 145 msg = '%s (element %s)' % (msg, node.tag, ) 146 raise GDSParseError(msg)
147 148
149 -class MixedContainer:
150 # Constants for category: 151 CategoryNone = 0 152 CategoryText = 1 153 CategorySimple = 2 154 CategoryComplex = 3 155 # Constants for content_type: 156 TypeNone = 0 157 TypeText = 1 158 TypeString = 2 159 TypeInteger = 3 160 TypeFloat = 4 161 TypeDecimal = 5 162 TypeDouble = 6 163 TypeBoolean = 7
164 - def __init__(self, category, content_type, name, value):
165 self.category = category 166 self.content_type = content_type 167 self.name = name 168 self.value = value
169 - def getCategory(self):
170 return self.category
171 - def getContenttype(self, content_type):
172 return self.content_type
173 - def getValue(self):
174 return self.value
175 - def getName(self):
176 return self.name
177 - def export(self, outfile, level, name, namespace):
178 if self.category == MixedContainer.CategoryText: 179 # Prevent exporting empty content as empty lines. 180 if self.value.strip(): 181 outfile.write(self.value) 182 elif self.category == MixedContainer.CategorySimple: 183 self.exportSimple(outfile, level, name) 184 else: # category == MixedContainer.CategoryComplex 185 self.value.export(outfile, level, namespace,name)
186 - def exportSimple(self, outfile, level, name):
187 if self.content_type == MixedContainer.TypeString: 188 outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name)) 189 elif self.content_type == MixedContainer.TypeInteger or \ 190 self.content_type == MixedContainer.TypeBoolean: 191 outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name)) 192 elif self.content_type == MixedContainer.TypeFloat or \ 193 self.content_type == MixedContainer.TypeDecimal: 194 outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name)) 195 elif self.content_type == MixedContainer.TypeDouble: 196 outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
197 - def exportLiteral(self, outfile, level, name):
198 if self.category == MixedContainer.CategoryText: 199 showIndent(outfile, level) 200 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ 201 (self.category, self.content_type, self.name, self.value)) 202 elif self.category == MixedContainer.CategorySimple: 203 showIndent(outfile, level) 204 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ 205 (self.category, self.content_type, self.name, self.value)) 206 else: # category == MixedContainer.CategoryComplex 207 showIndent(outfile, level) 208 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ 209 (self.category, self.content_type, self.name,)) 210 self.value.exportLiteral(outfile, level + 1) 211 showIndent(outfile, level) 212 outfile.write(')\n')
213 214
215 -class MemberSpec_(object):
216 - def __init__(self, name='', data_type='', container=0):
217 self.name = name 218 self.data_type = data_type 219 self.container = container
220 - def set_name(self, name): self.name = name
221 - def get_name(self): return self.name
222 - def set_data_type(self, data_type): self.data_type = data_type
223 - def get_data_type_chain(self): return self.data_type
224 - def get_data_type(self):
225 if isinstance(self.data_type, list): 226 if len(self.data_type) > 0: 227 return self.data_type[-1] 228 else: 229 return 'xs:string' 230 else: 231 return self.data_type
232 - def set_container(self, container): self.container = container
233 - def get_container(self): return self.container
234
235 -def _cast(typ, value):
236 if typ is None or value is None: 237 return value 238 return typ(value)
239 240 # 241 # Data representation classes. 242 # 243
244 -class siteCode(GeneratedsSuper):
245 """A &lt;siteCode&gt; is an identifier that this site is referred to 246 as. This Code used by organization that collects the data to 247 identify the site. A siteCode has a reference to it's source or 248 network as the @network. For waterWebServices, a site/location 249 is the network plus the value of the sitecode, eg 250 '@network:siteCode' siteCode identifiers often change, so 251 multiple siteCode elements are allowed There may be multiple 252 siteCode elements. Only one should be labeled as the default 253 using @defaultID (set attribute defaultID=true) Multiple 254 siteCode elements can utilize different observation networks may 255 refer to the same site with different identifiers. True if this 256 is the main identifier that this service uses to access this 257 site. default value is false. The abbreviation for the 258 datasource or observation network that this site code is 259 associated with. A siteCode has a reference to it's source or 260 network as the @network. For waterWebServices, a site/location 261 is the network plus the value of the sitecode, eg 262 '@network:siteCode'An internal numeric identifier of the site. 263 Code used to differentiate sites in a datasource. Agency codes 264 are specific to a data source, and are not required nor do they 265 need to be understood by a web service client.optional name to 266 provide more detail about an agency code""" 267 subclass = None 268 superclass = None
269 - def __init__(self, agencyCode=None, defaultId=None, siteID=None, network=None, agencyName=None, valueOf_=None):
270 self.agencyCode = _cast(None, agencyCode) 271 self.defaultId = _cast(bool, defaultId) 272 self.siteID = _cast(None, siteID) 273 self.network = _cast(None, network) 274 self.agencyName = _cast(None, agencyName) 275 self.valueOf_ = valueOf_
276 - def factory(*args_, **kwargs_):
277 if siteCode.subclass: 278 return siteCode.subclass(*args_, **kwargs_) 279 else: 280 return siteCode(*args_, **kwargs_)
281 factory = staticmethod(factory)
282 - def get_agencyCode(self): return self.agencyCode
283 - def set_agencyCode(self, agencyCode): self.agencyCode = agencyCode
284 - def get_defaultId(self): return self.defaultId
285 - def set_defaultId(self, defaultId): self.defaultId = defaultId
286 - def get_siteID(self): return self.siteID
287 - def set_siteID(self, siteID): self.siteID = siteID
288 - def get_network(self): return self.network
289 - def set_network(self, network): self.network = network
290 - def get_agencyName(self): return self.agencyName
291 - def set_agencyName(self, agencyName): self.agencyName = agencyName
292 - def get_valueOf_(self): return self.valueOf_
293 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
294 - def export(self, outfile, level, namespace_='', name_='siteCode', namespacedef_=''):
295 showIndent(outfile, level) 296 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 297 self.exportAttributes(outfile, level, [], namespace_, name_='siteCode') 298 if self.hasContent_(): 299 outfile.write('>') 300 outfile.write(self.valueOf_) 301 self.exportChildren(outfile, level + 1, namespace_, name_) 302 outfile.write('</%s%s>\n' % (namespace_, name_)) 303 else: 304 outfile.write('/>\n')
305 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='siteCode'):
306 if self.agencyCode is not None and 'agencyCode' not in already_processed: 307 already_processed.append('agencyCode') 308 outfile.write(' agencyCode=%s' % (self.gds_format_string(quote_attrib(self.agencyCode).encode(ExternalEncoding), input_name='agencyCode'), )) 309 if self.defaultId is not None and 'defaultId' not in already_processed: 310 already_processed.append('defaultId') 311 outfile.write(' defaultId="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.defaultId)), input_name='defaultId')) 312 if self.siteID is not None and 'siteID' not in already_processed: 313 already_processed.append('siteID') 314 outfile.write(' siteID=%s' % (self.gds_format_string(quote_attrib(self.siteID).encode(ExternalEncoding), input_name='siteID'), )) 315 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), )) 316 if self.agencyName is not None and 'agencyName' not in already_processed: 317 already_processed.append('agencyName') 318 outfile.write(' agencyName=%s' % (self.gds_format_string(quote_attrib(self.agencyName).encode(ExternalEncoding), input_name='agencyName'), ))
319 - def exportChildren(self, outfile, level, namespace_='', name_='siteCode'):
320 pass
321 - def hasContent_(self):
322 if ( 323 self.valueOf_ 324 ): 325 return True 326 else: 327 return False
328 - def exportLiteral(self, outfile, level, name_='siteCode'):
329 level += 1 330 self.exportLiteralAttributes(outfile, level, [], name_) 331 if self.hasContent_(): 332 self.exportLiteralChildren(outfile, level, name_) 333 showIndent(outfile, level) 334 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
335 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
336 if self.agencyCode is not None and 'agencyCode' not in already_processed: 337 already_processed.append('agencyCode') 338 showIndent(outfile, level) 339 outfile.write('agencyCode = "%s",\n' % (self.agencyCode,)) 340 if self.defaultId is not None and 'defaultId' not in already_processed: 341 already_processed.append('defaultId') 342 showIndent(outfile, level) 343 outfile.write('defaultId = %s,\n' % (self.defaultId,)) 344 if self.siteID is not None and 'siteID' not in already_processed: 345 already_processed.append('siteID') 346 showIndent(outfile, level) 347 outfile.write('siteID = "%s",\n' % (self.siteID,)) 348 if self.network is not None and 'network' not in already_processed: 349 already_processed.append('network') 350 showIndent(outfile, level) 351 outfile.write('network = "%s",\n' % (self.network,)) 352 if self.agencyName is not None and 'agencyName' not in already_processed: 353 already_processed.append('agencyName') 354 showIndent(outfile, level) 355 outfile.write('agencyName = "%s",\n' % (self.agencyName,))
356 - def exportLiteralChildren(self, outfile, level, name_):
357 pass
358 - def build(self, node):
359 self.buildAttributes(node, node.attrib, []) 360 self.valueOf_ = get_all_text_(node) 361 for child in node: 362 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 363 self.buildChildren(child, nodeName_)
364 - def buildAttributes(self, node, attrs, already_processed):
365 value = attrs.get('agencyCode') 366 if value is not None and 'agencyCode' not in already_processed: 367 already_processed.append('agencyCode') 368 self.agencyCode = value 369 value = attrs.get('defaultId') 370 if value is not None and 'defaultId' not in already_processed: 371 already_processed.append('defaultId') 372 if value in ('true', '1'): 373 self.defaultId = True 374 elif value in ('false', '0'): 375 self.defaultId = False 376 else: 377 raise_parse_error(node, 'Bad boolean attribute') 378 value = attrs.get('siteID') 379 if value is not None and 'siteID' not in already_processed: 380 already_processed.append('siteID') 381 self.siteID = value 382 value = attrs.get('network') 383 if value is not None and 'network' not in already_processed: 384 already_processed.append('network') 385 self.network = value 386 value = attrs.get('agencyName') 387 if value is not None and 'agencyName' not in already_processed: 388 already_processed.append('agencyName') 389 self.agencyName = value
390 - def buildChildren(self, child_, nodeName_, from_subclass=False):
391 pass
392 # end class siteCode 393 394
395 -class geoLocation(GeneratedsSuper):
396 """The geoLocation speficies the details of the geographic location. It 397 contains two portions, a geographic locaiton 398 &amp;lt;geogLocation&amp;gt;, and a local location 399 &amp;lt;localSiteXY&amp;gt;. In order to be discovered 400 spatially, geogLocation is required. The geogLocation can be of 401 GeogLocationType, which at present is either a latLonPoint or a 402 latLongBox. There may be multiple localSiteXY, which might be 403 used by data sources to provide other coordinated system 404 information, like UTM and State Plane coordinates.""" 405 subclass = None 406 superclass = None
407 - def __init__(self, geogLocation=None, localSiteXY=None):
408 self.geogLocation = geogLocation 409 if localSiteXY is None: 410 self.localSiteXY = [] 411 else: 412 self.localSiteXY = localSiteXY
413 - def factory(*args_, **kwargs_):
414 if geoLocation.subclass: 415 return geoLocation.subclass(*args_, **kwargs_) 416 else: 417 return geoLocation(*args_, **kwargs_)
418 factory = staticmethod(factory)
419 - def get_geogLocation(self): return self.geogLocation
420 - def set_geogLocation(self, geogLocation): self.geogLocation = geogLocation
421 - def get_localSiteXY(self): return self.localSiteXY
422 - def set_localSiteXY(self, localSiteXY): self.localSiteXY = localSiteXY
423 - def add_localSiteXY(self, value): self.localSiteXY.append(value)
424 - def insert_localSiteXY(self, index, value): self.localSiteXY[index] = value
425 - def export(self, outfile, level, namespace_='', name_='geoLocation', namespacedef_=''):
426 showIndent(outfile, level) 427 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 428 self.exportAttributes(outfile, level, [], namespace_, name_='geoLocation') 429 if self.hasContent_(): 430 outfile.write('>\n') 431 self.exportChildren(outfile, level + 1, namespace_, name_) 432 showIndent(outfile, level) 433 outfile.write('</%s%s>\n' % (namespace_, name_)) 434 else: 435 outfile.write('/>\n')
436 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='geoLocation'):
437 pass
438 - def exportChildren(self, outfile, level, namespace_='', name_='geoLocation'):
439 if self.geogLocation: 440 self.geogLocation.export(outfile, level, namespace_, name_='geogLocation', ) 441 for localSiteXY_ in self.localSiteXY: 442 localSiteXY_.export(outfile, level, namespace_, name_='localSiteXY')
443 - def hasContent_(self):
444 if ( 445 self.geogLocation is not None or 446 self.localSiteXY 447 ): 448 return True 449 else: 450 return False
451 - def exportLiteral(self, outfile, level, name_='geoLocation'):
452 level += 1 453 self.exportLiteralAttributes(outfile, level, [], name_) 454 if self.hasContent_(): 455 self.exportLiteralChildren(outfile, level, name_)
456 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
457 pass
458 - def exportLiteralChildren(self, outfile, level, name_):
459 if self.geogLocation is not None: 460 showIndent(outfile, level) 461 outfile.write('geogLocation=model_.GeogLocationType(\n') 462 self.geogLocation.exportLiteral(outfile, level, name_='geogLocation') 463 showIndent(outfile, level) 464 outfile.write('),\n') 465 showIndent(outfile, level) 466 outfile.write('localSiteXY=[\n') 467 level += 1 468 for localSiteXY_ in self.localSiteXY: 469 showIndent(outfile, level) 470 outfile.write('model_.localSiteXY(\n') 471 localSiteXY_.exportLiteral(outfile, level) 472 showIndent(outfile, level) 473 outfile.write('),\n') 474 level -= 1 475 showIndent(outfile, level) 476 outfile.write('],\n')
477 - def build(self, node):
478 self.buildAttributes(node, node.attrib, []) 479 for child in node: 480 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 481 self.buildChildren(child, nodeName_)
482 - def buildAttributes(self, node, attrs, already_processed):
483 pass
484 - def buildChildren(self, child_, nodeName_, from_subclass=False):
485 if nodeName_ == 'geogLocation': 486 obj_ = GeogLocationType.factory() 487 obj_.build(child_) 488 self.set_geogLocation(obj_) 489 elif nodeName_ == 'localSiteXY': 490 obj_ = localSiteXY.factory() 491 obj_.build(child_) 492 self.localSiteXY.append(obj_)
493 # end class geoLocation 494 495
496 -class localSiteXY(GeneratedsSuper):
497 """Site information can contain one or more other locations using the 498 localSiteXY element. The projection string should be stored in 499 projectionInformation. Lat or Northing = Y Lon or Easting = X 500 Spatial Reference System of the local coordinates. This should 501 use the PROJ4 projection string standard""" 502 subclass = None 503 superclass = None
504 - def __init__(self, projectionInformation=None, X=None, Y=None, Z=None, note=None):
505 self.projectionInformation = _cast(None, projectionInformation) 506 self.X = X 507 self.Y = Y 508 self.Z = Z 509 if note is None: 510 self.note = [] 511 else: 512 self.note = note
513 - def factory(*args_, **kwargs_):
514 if localSiteXY.subclass: 515 return localSiteXY.subclass(*args_, **kwargs_) 516 else: 517 return localSiteXY(*args_, **kwargs_)
518 factory = staticmethod(factory)
519 - def get_X(self): return self.X
520 - def set_X(self, X): self.X = X
521 - def get_Y(self): return self.Y
522 - def set_Y(self, Y): self.Y = Y
523 - def get_Z(self): return self.Z
524 - def set_Z(self, Z): self.Z = Z
525 - def get_note(self): return self.note
526 - def set_note(self, note): self.note = note
527 - def add_note(self, value): self.note.append(value)
528 - def insert_note(self, index, value): self.note[index] = value
529 - def get_projectionInformation(self): return self.projectionInformation
530 - def set_projectionInformation(self, projectionInformation): self.projectionInformation = projectionInformation
531 - def export(self, outfile, level, namespace_='', name_='localSiteXY', namespacedef_=''):
532 showIndent(outfile, level) 533 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 534 self.exportAttributes(outfile, level, [], namespace_, name_='localSiteXY') 535 if self.hasContent_(): 536 outfile.write('>\n') 537 self.exportChildren(outfile, level + 1, namespace_, name_) 538 showIndent(outfile, level) 539 outfile.write('</%s%s>\n' % (namespace_, name_)) 540 else: 541 outfile.write('/>\n')
542 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='localSiteXY'):
543 if self.projectionInformation is not None and 'projectionInformation' not in already_processed: 544 already_processed.append('projectionInformation') 545 outfile.write(' projectionInformation=%s' % (self.gds_format_string(quote_attrib(self.projectionInformation).encode(ExternalEncoding), input_name='projectionInformation'), ))
546 - def exportChildren(self, outfile, level, namespace_='', name_='localSiteXY'):
547 if self.X is not None: 548 showIndent(outfile, level) 549 outfile.write('<%sX>%s</%sX>\n' % (namespace_, self.gds_format_string(quote_xml(self.X).encode(ExternalEncoding), input_name='X'), namespace_)) 550 if self.Y is not None: 551 showIndent(outfile, level) 552 outfile.write('<%sY>%s</%sY>\n' % (namespace_, self.gds_format_string(quote_xml(self.Y).encode(ExternalEncoding), input_name='Y'), namespace_)) 553 if self.Z is not None: 554 showIndent(outfile, level) 555 outfile.write('<%sZ>%s</%sZ>\n' % (namespace_, self.gds_format_string(quote_xml(self.Z).encode(ExternalEncoding), input_name='Z'), namespace_)) 556 for note_ in self.note: 557 note_.export(outfile, level, namespace_, name_='note')
558 - def hasContent_(self):
559 if ( 560 self.X is not None or 561 self.Y is not None or 562 self.Z is not None or 563 self.note 564 ): 565 return True 566 else: 567 return False
568 - def exportLiteral(self, outfile, level, name_='localSiteXY'):
569 level += 1 570 self.exportLiteralAttributes(outfile, level, [], name_) 571 if self.hasContent_(): 572 self.exportLiteralChildren(outfile, level, name_)
573 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
574 if self.projectionInformation is not None and 'projectionInformation' not in already_processed: 575 already_processed.append('projectionInformation') 576 showIndent(outfile, level) 577 outfile.write('projectionInformation = "%s",\n' % (self.projectionInformation,))
578 - def exportLiteralChildren(self, outfile, level, name_):
579 if self.X is not None: 580 showIndent(outfile, level) 581 outfile.write('X=%s,\n' % quote_python(self.X).encode(ExternalEncoding)) 582 if self.Y is not None: 583 showIndent(outfile, level) 584 outfile.write('Y=%s,\n' % quote_python(self.Y).encode(ExternalEncoding)) 585 if self.Z is not None: 586 showIndent(outfile, level) 587 outfile.write('Z=%s,\n' % quote_python(self.Z).encode(ExternalEncoding)) 588 showIndent(outfile, level) 589 outfile.write('note=[\n') 590 level += 1 591 for note_ in self.note: 592 showIndent(outfile, level) 593 outfile.write('model_.NoteType(\n') 594 note_.exportLiteral(outfile, level, name_='NoteType') 595 showIndent(outfile, level) 596 outfile.write('),\n') 597 level -= 1 598 showIndent(outfile, level) 599 outfile.write('],\n')
600 - def build(self, node):
601 self.buildAttributes(node, node.attrib, []) 602 for child in node: 603 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 604 self.buildChildren(child, nodeName_)
605 - def buildAttributes(self, node, attrs, already_processed):
606 value = attrs.get('projectionInformation') 607 if value is not None and 'projectionInformation' not in already_processed: 608 already_processed.append('projectionInformation') 609 self.projectionInformation = value
610 - def buildChildren(self, child_, nodeName_, from_subclass=False):
611 if nodeName_ == 'X': 612 X_ = child_.text 613 self.X = X_ 614 elif nodeName_ == 'Y': 615 Y_ = child_.text 616 self.Y = Y_ 617 elif nodeName_ == 'Z': 618 Z_ = child_.text 619 self.Z = Z_ 620 elif nodeName_ == 'note': 621 obj_ = NoteType.factory() 622 obj_.build(child_) 623 self.note.append(obj_)
624 # end class localSiteXY 625 626
627 -class TsValuesSingleVariableType(GeneratedsSuper):
628 """TsValuesSingleVariableTypea aggregates the list of values and 629 associated metadata. It is the values element in the 630 timeSereisResponse Attributes are optional, but use @count is 631 encouraged. The atrributes @unitsAreConverted, 632 @untsCode,@unitsAbbreviation, and @unitsType were originally 633 included to allow for translation from orignal variable units. 634 Thier use is not encouraged. Get unit information from the 635 Variable element.If a webservice has transformed the time zone 636 from the original data.the measurment units of the value 637 elements in this values element True if a webservice has 638 transformed the data from the original units.""" 639 subclass = None 640 superclass = None
641 - def __init__(self, count=None, unitsAbbreviation=None, unitsType=None, timeZoneShiftApplied=None, unitsAreConverted=False, unitsCode=None, value=None, qualifier=None, qualityControlLevel=None, method=None, source=None, offset=None):
642 self.count = _cast(int, count) 643 self.unitsAbbreviation = _cast(None, unitsAbbreviation) 644 self.unitsType = _cast(None, unitsType) 645 self.timeZoneShiftApplied = _cast(bool, timeZoneShiftApplied) 646 self.unitsAreConverted = _cast(bool, unitsAreConverted) 647 self.unitsCode = _cast(None, unitsCode) 648 if value is None: 649 self.value = [] 650 else: 651 self.value = value 652 if qualifier is None: 653 self.qualifier = [] 654 else: 655 self.qualifier = qualifier 656 if qualityControlLevel is None: 657 self.qualityControlLevel = [] 658 else: 659 self.qualityControlLevel = qualityControlLevel 660 if method is None: 661 self.method = [] 662 else: 663 self.method = method 664 if source is None: 665 self.source = [] 666 else: 667 self.source = source 668 if offset is None: 669 self.offset = [] 670 else: 671 self.offset = offset
672 - def factory(*args_, **kwargs_):
673 if TsValuesSingleVariableType.subclass: 674 return TsValuesSingleVariableType.subclass(*args_, **kwargs_) 675 else: 676 return TsValuesSingleVariableType(*args_, **kwargs_)
677 factory = staticmethod(factory)
678 - def get_value(self): return self.value
679 - def set_value(self, value): self.value = value
680 - def add_value(self, value): self.value.append(value)
681 - def insert_value(self, index, value): self.value[index] = value
682 - def get_qualifier(self): return self.qualifier
683 - def set_qualifier(self, qualifier): self.qualifier = qualifier
684 - def add_qualifier(self, value): self.qualifier.append(value)
685 - def insert_qualifier(self, index, value): self.qualifier[index] = value
686 - def get_qualityControlLevel(self): return self.qualityControlLevel
687 - def set_qualityControlLevel(self, qualityControlLevel): self.qualityControlLevel = qualityControlLevel
688 - def add_qualityControlLevel(self, value): self.qualityControlLevel.append(value)
689 - def insert_qualityControlLevel(self, index, value): self.qualityControlLevel[index] = value
690 - def get_method(self): return self.method
691 - def set_method(self, method): self.method = method
692 - def add_method(self, value): self.method.append(value)
693 - def insert_method(self, index, value): self.method[index] = value
694 - def get_source(self): return self.source
695 - def set_source(self, source): self.source = source
696 - def add_source(self, value): self.source.append(value)
697 - def insert_source(self, index, value): self.source[index] = value
698 - def get_offset(self): return self.offset
699 - def set_offset(self, offset): self.offset = offset
700 - def add_offset(self, value): self.offset.append(value)
701 - def insert_offset(self, index, value): self.offset[index] = value
702 - def get_count(self): return self.count
703 - def set_count(self, count): self.count = count
704 - def get_unitsAbbreviation(self): return self.unitsAbbreviation
705 - def set_unitsAbbreviation(self, unitsAbbreviation): self.unitsAbbreviation = unitsAbbreviation
706 - def get_unitsType(self): return self.unitsType
707 - def set_unitsType(self, unitsType): self.unitsType = unitsType
708 - def validate_UnitsTypeEnum(self, value):
709 # Validate type UnitsTypeEnum, a restriction on xsi:string. 710 pass
711 - def get_timeZoneShiftApplied(self): return self.timeZoneShiftApplied
712 - def set_timeZoneShiftApplied(self, timeZoneShiftApplied): self.timeZoneShiftApplied = timeZoneShiftApplied
713 - def get_unitsAreConverted(self): return self.unitsAreConverted
714 - def set_unitsAreConverted(self, unitsAreConverted): self.unitsAreConverted = unitsAreConverted
715 - def get_unitsCode(self): return self.unitsCode
716 - def set_unitsCode(self, unitsCode): self.unitsCode = unitsCode
717 - def export(self, outfile, level, namespace_='', name_='TsValuesSingleVariableType', namespacedef_=''):
718 showIndent(outfile, level) 719 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 720 self.exportAttributes(outfile, level, [], namespace_, name_='TsValuesSingleVariableType') 721 if self.hasContent_(): 722 outfile.write('>\n') 723 self.exportChildren(outfile, level + 1, namespace_, name_) 724 showIndent(outfile, level) 725 outfile.write('</%s%s>\n' % (namespace_, name_)) 726 else: 727 outfile.write('/>\n')
728 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TsValuesSingleVariableType'):
729 if self.count is not None and 'count' not in already_processed: 730 already_processed.append('count') 731 outfile.write(' count="%s"' % self.gds_format_integer(self.count, input_name='count')) 732 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed: 733 already_processed.append('unitsAbbreviation') 734 outfile.write(' unitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.unitsAbbreviation).encode(ExternalEncoding), input_name='unitsAbbreviation'), )) 735 if self.unitsType is not None and 'unitsType' not in already_processed: 736 already_processed.append('unitsType') 737 outfile.write(' unitsType=%s' % (quote_attrib(self.unitsType), )) 738 if self.timeZoneShiftApplied is not None and 'timeZoneShiftApplied' not in already_processed: 739 already_processed.append('timeZoneShiftApplied') 740 outfile.write(' timeZoneShiftApplied="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.timeZoneShiftApplied)), input_name='timeZoneShiftApplied')) 741 if self.unitsAreConverted is not None and 'unitsAreConverted' not in already_processed: 742 already_processed.append('unitsAreConverted') 743 outfile.write(' unitsAreConverted="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.unitsAreConverted)), input_name='unitsAreConverted')) 744 if self.unitsCode is not None and 'unitsCode' not in already_processed: 745 already_processed.append('unitsCode') 746 outfile.write(' unitsCode=%s' % (self.gds_format_string(quote_attrib(self.unitsCode).encode(ExternalEncoding), input_name='unitsCode'), ))
747 - def exportChildren(self, outfile, level, namespace_='', name_='TsValuesSingleVariableType'):
748 for value_ in self.value: 749 value_.export(outfile, level, namespace_, name_='value') 750 for qualifier_ in self.qualifier: 751 qualifier_.export(outfile, level, namespace_, name_='qualifier') 752 for qualityControlLevel_ in self.qualityControlLevel: 753 qualityControlLevel_.export(outfile, level, namespace_, name_='qualityControlLevel') 754 for method_ in self.method: 755 method_.export(outfile, level, namespace_, name_='method') 756 for source_ in self.source: 757 source_.export(outfile, level, namespace_, name_='source') 758 for offset_ in self.offset: 759 offset_.export(outfile, level, namespace_, name_='offset')
760 - def hasContent_(self):
761 if ( 762 self.value or 763 self.qualifier or 764 self.qualityControlLevel or 765 self.method or 766 self.source or 767 self.offset 768 ): 769 return True 770 else: 771 return False
772 - def exportLiteral(self, outfile, level, name_='TsValuesSingleVariableType'):
773 level += 1 774 self.exportLiteralAttributes(outfile, level, [], name_) 775 if self.hasContent_(): 776 self.exportLiteralChildren(outfile, level, name_)
777 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
778 if self.count is not None and 'count' not in already_processed: 779 already_processed.append('count') 780 showIndent(outfile, level) 781 outfile.write('count = %d,\n' % (self.count,)) 782 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed: 783 already_processed.append('unitsAbbreviation') 784 showIndent(outfile, level) 785 outfile.write('unitsAbbreviation = "%s",\n' % (self.unitsAbbreviation,)) 786 if self.unitsType is not None and 'unitsType' not in already_processed: 787 already_processed.append('unitsType') 788 showIndent(outfile, level) 789 outfile.write('unitsType = "%s",\n' % (self.unitsType,)) 790 if self.timeZoneShiftApplied is not None and 'timeZoneShiftApplied' not in already_processed: 791 already_processed.append('timeZoneShiftApplied') 792 showIndent(outfile, level) 793 outfile.write('timeZoneShiftApplied = %s,\n' % (self.timeZoneShiftApplied,)) 794 if self.unitsAreConverted is not None and 'unitsAreConverted' not in already_processed: 795 already_processed.append('unitsAreConverted') 796 showIndent(outfile, level) 797 outfile.write('unitsAreConverted = %s,\n' % (self.unitsAreConverted,)) 798 if self.unitsCode is not None and 'unitsCode' not in already_processed: 799 already_processed.append('unitsCode') 800 showIndent(outfile, level) 801 outfile.write('unitsCode = "%s",\n' % (self.unitsCode,))
802 - def exportLiteralChildren(self, outfile, level, name_):
803 showIndent(outfile, level) 804 outfile.write('value=[\n') 805 level += 1 806 for value_ in self.value: 807 showIndent(outfile, level) 808 outfile.write('model_.ValueSingleVariable(\n') 809 value_.exportLiteral(outfile, level, name_='ValueSingleVariable') 810 showIndent(outfile, level) 811 outfile.write('),\n') 812 level -= 1 813 showIndent(outfile, level) 814 outfile.write('],\n') 815 showIndent(outfile, level) 816 outfile.write('qualifier=[\n') 817 level += 1 818 for qualifier_ in self.qualifier: 819 showIndent(outfile, level) 820 outfile.write('model_.qualifier(\n') 821 qualifier_.exportLiteral(outfile, level) 822 showIndent(outfile, level) 823 outfile.write('),\n') 824 level -= 1 825 showIndent(outfile, level) 826 outfile.write('],\n') 827 showIndent(outfile, level) 828 outfile.write('qualityControlLevel=[\n') 829 level += 1 830 for qualityControlLevel_ in self.qualityControlLevel: 831 showIndent(outfile, level) 832 outfile.write('model_.qualityControlLevel(\n') 833 qualityControlLevel_.exportLiteral(outfile, level) 834 showIndent(outfile, level) 835 outfile.write('),\n') 836 level -= 1 837 showIndent(outfile, level) 838 outfile.write('],\n') 839 showIndent(outfile, level) 840 outfile.write('method=[\n') 841 level += 1 842 for method_ in self.method: 843 showIndent(outfile, level) 844 outfile.write('model_.MethodType(\n') 845 method_.exportLiteral(outfile, level, name_='MethodType') 846 showIndent(outfile, level) 847 outfile.write('),\n') 848 level -= 1 849 showIndent(outfile, level) 850 outfile.write('],\n') 851 showIndent(outfile, level) 852 outfile.write('source=[\n') 853 level += 1 854 for source_ in self.source: 855 showIndent(outfile, level) 856 outfile.write('model_.SourceType(\n') 857 source_.exportLiteral(outfile, level, name_='SourceType') 858 showIndent(outfile, level) 859 outfile.write('),\n') 860 level -= 1 861 showIndent(outfile, level) 862 outfile.write('],\n') 863 showIndent(outfile, level) 864 outfile.write('offset=[\n') 865 level += 1 866 for offset_ in self.offset: 867 showIndent(outfile, level) 868 outfile.write('model_.OffsetType(\n') 869 offset_.exportLiteral(outfile, level, name_='OffsetType') 870 showIndent(outfile, level) 871 outfile.write('),\n') 872 level -= 1 873 showIndent(outfile, level) 874 outfile.write('],\n')
875 - def build(self, node):
876 self.buildAttributes(node, node.attrib, []) 877 for child in node: 878 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 879 self.buildChildren(child, nodeName_)
880 - def buildAttributes(self, node, attrs, already_processed):
881 value = attrs.get('count') 882 if value is not None and 'count' not in already_processed: 883 already_processed.append('count') 884 try: 885 self.count = int(value) 886 except ValueError, exp: 887 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 888 if self.count < 0: 889 raise_parse_error(node, 'Invalid NonNegativeInteger') 890 value = attrs.get('unitsAbbreviation') 891 if value is not None and 'unitsAbbreviation' not in already_processed: 892 already_processed.append('unitsAbbreviation') 893 self.unitsAbbreviation = value 894 value = attrs.get('unitsType') 895 if value is not None and 'unitsType' not in already_processed: 896 already_processed.append('unitsType') 897 self.unitsType = value 898 value = attrs.get('timeZoneShiftApplied') 899 if value is not None and 'timeZoneShiftApplied' not in already_processed: 900 already_processed.append('timeZoneShiftApplied') 901 if value in ('true', '1'): 902 self.timeZoneShiftApplied = True 903 elif value in ('false', '0'): 904 self.timeZoneShiftApplied = False 905 else: 906 raise_parse_error(node, 'Bad boolean attribute') 907 value = attrs.get('unitsAreConverted') 908 if value is not None and 'unitsAreConverted' not in already_processed: 909 already_processed.append('unitsAreConverted') 910 if value in ('true', '1'): 911 self.unitsAreConverted = True 912 elif value in ('false', '0'): 913 self.unitsAreConverted = False 914 else: 915 raise_parse_error(node, 'Bad boolean attribute') 916 value = attrs.get('unitsCode') 917 if value is not None and 'unitsCode' not in already_processed: 918 already_processed.append('unitsCode') 919 self.unitsCode = value 920 self.unitsCode = ' '.join(self.unitsCode.split())
921 - def buildChildren(self, child_, nodeName_, from_subclass=False):
922 if nodeName_ == 'value': 923 obj_ = ValueSingleVariable.factory() 924 obj_.build(child_) 925 self.value.append(obj_) 926 elif nodeName_ == 'qualifier': 927 obj_ = qualifier.factory() 928 obj_.build(child_) 929 self.qualifier.append(obj_) 930 elif nodeName_ == 'qualityControlLevel': 931 obj_ = qualityControlLevel.factory() 932 obj_.build(child_) 933 self.qualityControlLevel.append(obj_) 934 elif nodeName_ == 'method': 935 obj_ = MethodType.factory() 936 obj_.build(child_) 937 self.method.append(obj_) 938 elif nodeName_ == 'source': 939 obj_ = SourceType.factory() 940 obj_.build(child_) 941 self.source.append(obj_) 942 elif nodeName_ == 'offset': 943 obj_ = OffsetType.factory() 944 obj_.build(child_) 945 self.offset.append(obj_)
946 # end class TsValuesSingleVariableType 947 948
949 -class VariableInfoType(GeneratedsSuper):
950 """VariableInfoType is a complex type containting full descriptive 951 information about a variable, as described by the ODM. This 952 includes one or more variable codes, the short variable name, a 953 detailed variable description, and suggest It also extends the 954 ODM model, in several methods: - options contain extended 955 reuqest information. - note(s) are for generic extension. - 956 extension is an element where additional namespace information 957 should be placed. - related allows for parent and child 958 relationships between variables to be communicated.""" 959 subclass = None 960 superclass = None
961 - def __init__(self, metadataDateTime=None, oid=None, variableCode=None, variableName=None, variableDescription=None, valueType=None, dataType=None, generalCategory=None, sampleMedium=None, units=None, options=None, note=None, related=None, extension=None, NoDataValue=None, timeSupport=None):
962 self.metadataDateTime = _cast(None, metadataDateTime) 963 self.oid = _cast(None, oid) 964 if variableCode is None: 965 self.variableCode = [] 966 else: 967 self.variableCode = variableCode 968 self.variableName = variableName 969 self.variableDescription = variableDescription 970 self.valueType = valueType 971 self.dataType = dataType 972 self.generalCategory = generalCategory 973 self.sampleMedium = sampleMedium 974 self.units = units 975 self.options = options 976 if note is None: 977 self.note = [] 978 else: 979 self.note = note 980 self.related = related 981 self.extension = extension 982 self.NoDataValue = NoDataValue 983 self.timeSupport = timeSupport
984 - def factory(*args_, **kwargs_):
985 if VariableInfoType.subclass: 986 return VariableInfoType.subclass(*args_, **kwargs_) 987 else: 988 return VariableInfoType(*args_, **kwargs_)
989 factory = staticmethod(factory)
990 - def get_variableCode(self): return self.variableCode
991 - def set_variableCode(self, variableCode): self.variableCode = variableCode
992 - def add_variableCode(self, value): self.variableCode.append(value)
993 - def insert_variableCode(self, index, value): self.variableCode[index] = value
994 - def get_variableName(self): return self.variableName
995 - def set_variableName(self, variableName): self.variableName = variableName
996 - def get_variableDescription(self): return self.variableDescription
997 - def set_variableDescription(self, variableDescription): self.variableDescription = variableDescription
998 - def get_valueType(self): return self.valueType
999 - def set_valueType(self, valueType): self.valueType = valueType
1000 - def validate_valueType(self, value):
1001 # validate type valueType 1002 pass
1003 - def get_dataType(self): return self.dataType
1004 - def set_dataType(self, dataType): self.dataType = dataType
1005 - def validate_dataType(self, value):
1006 # validate type dataType 1007 pass
1008 - def get_generalCategory(self): return self.generalCategory
1009 - def set_generalCategory(self, generalCategory): self.generalCategory = generalCategory
1010 - def validate_generalCategory(self, value):
1011 # validate type generalCategory 1012 pass
1013 - def get_sampleMedium(self): return self.sampleMedium
1014 - def set_sampleMedium(self, sampleMedium): self.sampleMedium = sampleMedium
1015 - def validate_sampleMedium(self, value):
1016 # validate type sampleMedium 1017 pass
1018 - def get_units(self): return self.units
1019 - def set_units(self, units): self.units = units
1020 - def get_options(self): return self.options
1021 - def set_options(self, options): self.options = options
1022 - def get_note(self): return self.note
1023 - def set_note(self, note): self.note = note
1024 - def add_note(self, value): self.note.append(value)
1025 - def insert_note(self, index, value): self.note[index] = value
1028 - def get_extension(self): return self.extension
1029 - def set_extension(self, extension): self.extension = extension
1030 - def get_NoDataValue(self): return self.NoDataValue
1031 - def set_NoDataValue(self, NoDataValue): self.NoDataValue = NoDataValue
1032 - def get_timeSupport(self): return self.timeSupport
1033 - def set_timeSupport(self, timeSupport): self.timeSupport = timeSupport
1034 - def get_metadataDateTime(self): return self.metadataDateTime
1035 - def set_metadataDateTime(self, metadataDateTime): self.metadataDateTime = metadataDateTime
1036 - def get_oid(self): return self.oid
1037 - def set_oid(self, oid): self.oid = oid
1038 - def export(self, outfile, level, namespace_='', name_='VariableInfoType', namespacedef_=''):
1039 showIndent(outfile, level) 1040 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1041 self.exportAttributes(outfile, level, [], namespace_, name_='VariableInfoType') 1042 if self.hasContent_(): 1043 outfile.write('>\n') 1044 self.exportChildren(outfile, level + 1, namespace_, name_) 1045 showIndent(outfile, level) 1046 outfile.write('</%s%s>\n' % (namespace_, name_)) 1047 else: 1048 outfile.write('/>\n')
1049 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='VariableInfoType'):
1050 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 1051 already_processed.append('metadataDateTime') 1052 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), )) 1053 if self.oid is not None and 'oid' not in already_processed: 1054 already_processed.append('oid') 1055 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
1056 - def exportChildren(self, outfile, level, namespace_='', name_='VariableInfoType'):
1057 for variableCode_ in self.variableCode: 1058 variableCode_.export(outfile, level, namespace_, name_='variableCode') 1059 if self.variableName is not None: 1060 showIndent(outfile, level) 1061 outfile.write('<%svariableName>%s</%svariableName>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableName).encode(ExternalEncoding), input_name='variableName'), namespace_)) 1062 if self.variableDescription is not None: 1063 showIndent(outfile, level) 1064 outfile.write('<%svariableDescription>%s</%svariableDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableDescription).encode(ExternalEncoding), input_name='variableDescription'), namespace_)) 1065 if self.valueType is not None: 1066 showIndent(outfile, level) 1067 outfile.write('<%svalueType>%s</%svalueType>\n' % (namespace_, self.gds_format_string(quote_xml(self.valueType).encode(ExternalEncoding), input_name='valueType'), namespace_)) 1068 if self.dataType is not None: 1069 showIndent(outfile, level) 1070 outfile.write('<%sdataType>%s</%sdataType>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataType).encode(ExternalEncoding), input_name='dataType'), namespace_)) 1071 if self.generalCategory is not None: 1072 showIndent(outfile, level) 1073 outfile.write('<%sgeneralCategory>%s</%sgeneralCategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.generalCategory).encode(ExternalEncoding), input_name='generalCategory'), namespace_)) 1074 if self.sampleMedium is not None: 1075 showIndent(outfile, level) 1076 outfile.write('<%ssampleMedium>%s</%ssampleMedium>\n' % (namespace_, self.gds_format_string(quote_xml(self.sampleMedium).encode(ExternalEncoding), input_name='sampleMedium'), namespace_)) 1077 if self.units: 1078 self.units.export(outfile, level, namespace_, name_='units') 1079 if self.options: 1080 self.options.export(outfile, level, namespace_, name_='options') 1081 for note_ in self.note: 1082 note_.export(outfile, level, namespace_, name_='note') 1083 if self.related: 1084 self.related.export(outfile, level, namespace_, name_='related') 1085 if self.extension is not None: 1086 showIndent(outfile, level) 1087 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_)) 1088 if self.NoDataValue is not None: 1089 showIndent(outfile, level) 1090 outfile.write('<%sNoDataValue>%s</%sNoDataValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.NoDataValue).encode(ExternalEncoding), input_name='NoDataValue'), namespace_)) 1091 if self.timeSupport: 1092 self.timeSupport.export(outfile, level, namespace_, name_='timeSupport')
1093 - def hasContent_(self):
1094 if ( 1095 self.variableCode or 1096 self.variableName is not None or 1097 self.variableDescription is not None or 1098 self.valueType is not None or 1099 self.dataType is not None or 1100 self.generalCategory is not None or 1101 self.sampleMedium is not None or 1102 self.units is not None or 1103 self.options is not None or 1104 self.note or 1105 self.related is not None or 1106 self.extension is not None or 1107 self.NoDataValue is not None or 1108 self.timeSupport is not None 1109 ): 1110 return True 1111 else: 1112 return False
1113 - def exportLiteral(self, outfile, level, name_='VariableInfoType'):
1114 level += 1 1115 self.exportLiteralAttributes(outfile, level, [], name_) 1116 if self.hasContent_(): 1117 self.exportLiteralChildren(outfile, level, name_)
1118 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1119 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 1120 already_processed.append('metadataDateTime') 1121 showIndent(outfile, level) 1122 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,)) 1123 if self.oid is not None and 'oid' not in already_processed: 1124 already_processed.append('oid') 1125 showIndent(outfile, level) 1126 outfile.write('oid = "%s",\n' % (self.oid,))
1127 - def exportLiteralChildren(self, outfile, level, name_):
1128 showIndent(outfile, level) 1129 outfile.write('variableCode=[\n') 1130 level += 1 1131 for variableCode_ in self.variableCode: 1132 showIndent(outfile, level) 1133 outfile.write('model_.variableCode(\n') 1134 variableCode_.exportLiteral(outfile, level) 1135 showIndent(outfile, level) 1136 outfile.write('),\n') 1137 level -= 1 1138 showIndent(outfile, level) 1139 outfile.write('],\n') 1140 if self.variableName is not None: 1141 showIndent(outfile, level) 1142 outfile.write('variableName=%s,\n' % quote_python(self.variableName).encode(ExternalEncoding)) 1143 if self.variableDescription is not None: 1144 showIndent(outfile, level) 1145 outfile.write('variableDescription=%s,\n' % quote_python(self.variableDescription).encode(ExternalEncoding)) 1146 if self.valueType is not None: 1147 showIndent(outfile, level) 1148 outfile.write('valueType=%s,\n' % quote_python(self.valueType).encode(ExternalEncoding)) 1149 if self.dataType is not None: 1150 showIndent(outfile, level) 1151 outfile.write('dataType=%s,\n' % quote_python(self.dataType).encode(ExternalEncoding)) 1152 if self.generalCategory is not None: 1153 showIndent(outfile, level) 1154 outfile.write('generalCategory=%s,\n' % quote_python(self.generalCategory).encode(ExternalEncoding)) 1155 if self.sampleMedium is not None: 1156 showIndent(outfile, level) 1157 outfile.write('sampleMedium=%s,\n' % quote_python(self.sampleMedium).encode(ExternalEncoding)) 1158 if self.units is not None: 1159 showIndent(outfile, level) 1160 outfile.write('units=model_.units(\n') 1161 self.units.exportLiteral(outfile, level) 1162 showIndent(outfile, level) 1163 outfile.write('),\n') 1164 if self.options is not None: 1165 showIndent(outfile, level) 1166 outfile.write('options=model_.options(\n') 1167 self.options.exportLiteral(outfile, level) 1168 showIndent(outfile, level) 1169 outfile.write('),\n') 1170 showIndent(outfile, level) 1171 outfile.write('note=[\n') 1172 level += 1 1173 for note_ in self.note: 1174 showIndent(outfile, level) 1175 outfile.write('model_.NoteType(\n') 1176 note_.exportLiteral(outfile, level, name_='NoteType') 1177 showIndent(outfile, level) 1178 outfile.write('),\n') 1179 level -= 1 1180 showIndent(outfile, level) 1181 outfile.write('],\n') 1182 if self.related is not None: 1183 showIndent(outfile, level) 1184 outfile.write('related=model_.related(\n') 1185 self.related.exportLiteral(outfile, level) 1186 showIndent(outfile, level) 1187 outfile.write('),\n') 1188 if self.extension is not None: 1189 showIndent(outfile, level) 1190 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding)) 1191 if self.NoDataValue is not None: 1192 showIndent(outfile, level) 1193 outfile.write('NoDataValue=%s,\n' % quote_python(self.NoDataValue).encode(ExternalEncoding)) 1194 if self.timeSupport is not None: 1195 showIndent(outfile, level) 1196 outfile.write('timeSupport=model_.timeSupport(\n') 1197 self.timeSupport.exportLiteral(outfile, level) 1198 showIndent(outfile, level) 1199 outfile.write('),\n')
1200 - def build(self, node):
1201 self.buildAttributes(node, node.attrib, []) 1202 for child in node: 1203 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1204 self.buildChildren(child, nodeName_)
1205 - def buildAttributes(self, node, attrs, already_processed):
1206 value = attrs.get('metadataDateTime') 1207 if value is not None and 'metadataDateTime' not in already_processed: 1208 already_processed.append('metadataDateTime') 1209 self.metadataDateTime = value 1210 value = attrs.get('oid') 1211 if value is not None and 'oid' not in already_processed: 1212 already_processed.append('oid') 1213 self.oid = value
1214 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1215 if nodeName_ == 'variableCode': 1216 obj_ = variableCode.factory() 1217 obj_.build(child_) 1218 self.variableCode.append(obj_) 1219 elif nodeName_ == 'variableName': 1220 variableName_ = child_.text 1221 self.variableName = variableName_ 1222 elif nodeName_ == 'variableDescription': 1223 variableDescription_ = child_.text 1224 self.variableDescription = variableDescription_ 1225 elif nodeName_ == 'valueType': 1226 valueType_ = child_.text 1227 self.valueType = valueType_ 1228 self.validate_valueType(self.valueType) # validate type valueType 1229 elif nodeName_ == 'dataType': 1230 dataType_ = child_.text 1231 self.dataType = dataType_ 1232 self.validate_dataType(self.dataType) # validate type dataType 1233 elif nodeName_ == 'generalCategory': 1234 generalCategory_ = child_.text 1235 self.generalCategory = generalCategory_ 1236 self.validate_generalCategory(self.generalCategory) # validate type generalCategory 1237 elif nodeName_ == 'sampleMedium': 1238 sampleMedium_ = child_.text 1239 self.sampleMedium = sampleMedium_ 1240 self.validate_sampleMedium(self.sampleMedium) # validate type sampleMedium 1241 elif nodeName_ == 'units': 1242 obj_ = units.factory() 1243 obj_.build(child_) 1244 self.set_units(obj_) 1245 elif nodeName_ == 'options': 1246 obj_ = options.factory() 1247 obj_.build(child_) 1248 self.set_options(obj_) 1249 elif nodeName_ == 'note': 1250 obj_ = NoteType.factory() 1251 obj_.build(child_) 1252 self.note.append(obj_) 1253 elif nodeName_ == 'related': 1254 obj_ = related.factory() 1255 obj_.build(child_) 1256 self.set_related(obj_) 1257 elif nodeName_ == 'extension': 1258 extension_ = child_.text 1259 self.extension = extension_ 1260 elif nodeName_ == 'NoDataValue': 1261 NoDataValue_ = child_.text 1262 self.NoDataValue = NoDataValue_ 1263 elif nodeName_ == 'timeSupport': 1264 obj_ = timeSupport.factory() 1265 obj_.build(child_) 1266 self.set_timeSupport(obj_)
1267 # end class VariableInfoType 1268 1269 1345 # end class related 1346 1347
1348 -class parentID(GeneratedsSuper):
1349 """variableCode for the parent""" 1350 subclass = None 1351 superclass = None
1352 - def __init__(self, default=None, network=None, vocabulary=None, valueOf_=None):
1353 self.default = _cast(bool, default) 1354 self.network = _cast(None, network) 1355 self.vocabulary = _cast(None, vocabulary) 1356 self.valueOf_ = valueOf_
1357 - def factory(*args_, **kwargs_):
1358 if parentID.subclass: 1359 return parentID.subclass(*args_, **kwargs_) 1360 else: 1361 return parentID(*args_, **kwargs_)
1362 factory = staticmethod(factory)
1363 - def get_default(self): return self.default
1364 - def set_default(self, default): self.default = default
1365 - def get_network(self): return self.network
1366 - def set_network(self, network): self.network = network
1367 - def get_vocabulary(self): return self.vocabulary
1368 - def set_vocabulary(self, vocabulary): self.vocabulary = vocabulary
1369 - def get_valueOf_(self): return self.valueOf_
1370 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
1371 - def export(self, outfile, level, namespace_='', name_='parentID', namespacedef_=''):
1372 showIndent(outfile, level) 1373 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1374 self.exportAttributes(outfile, level, [], namespace_, name_='parentID') 1375 if self.hasContent_(): 1376 outfile.write('>') 1377 outfile.write(self.valueOf_) 1378 self.exportChildren(outfile, level + 1, namespace_, name_) 1379 outfile.write('</%s%s>\n' % (namespace_, name_)) 1380 else: 1381 outfile.write('/>\n')
1382 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='parentID'):
1383 if self.default is not None and 'default' not in already_processed: 1384 already_processed.append('default') 1385 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default')) 1386 if self.network is not None and 'network' not in already_processed: 1387 already_processed.append('network') 1388 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), )) 1389 if self.vocabulary is not None and 'vocabulary' not in already_processed: 1390 already_processed.append('vocabulary') 1391 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
1392 - def exportChildren(self, outfile, level, namespace_='', name_='parentID'):
1393 pass
1394 - def hasContent_(self):
1395 if ( 1396 self.valueOf_ 1397 ): 1398 return True 1399 else: 1400 return False
1401 - def exportLiteral(self, outfile, level, name_='parentID'):
1402 level += 1 1403 self.exportLiteralAttributes(outfile, level, [], name_) 1404 if self.hasContent_(): 1405 self.exportLiteralChildren(outfile, level, name_) 1406 showIndent(outfile, level) 1407 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
1408 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1409 if self.default is not None and 'default' not in already_processed: 1410 already_processed.append('default') 1411 showIndent(outfile, level) 1412 outfile.write('default = %s,\n' % (self.default,)) 1413 if self.network is not None and 'network' not in already_processed: 1414 already_processed.append('network') 1415 showIndent(outfile, level) 1416 outfile.write('network = "%s",\n' % (self.network,)) 1417 if self.vocabulary is not None and 'vocabulary' not in already_processed: 1418 already_processed.append('vocabulary') 1419 showIndent(outfile, level) 1420 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
1421 - def exportLiteralChildren(self, outfile, level, name_):
1422 pass
1423 - def build(self, node):
1424 self.buildAttributes(node, node.attrib, []) 1425 self.valueOf_ = get_all_text_(node) 1426 for child in node: 1427 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1428 self.buildChildren(child, nodeName_)
1429 - def buildAttributes(self, node, attrs, already_processed):
1430 value = attrs.get('default') 1431 if value is not None and 'default' not in already_processed: 1432 already_processed.append('default') 1433 if value in ('true', '1'): 1434 self.default = True 1435 elif value in ('false', '0'): 1436 self.default = False 1437 else: 1438 raise_parse_error(node, 'Bad boolean attribute') 1439 value = attrs.get('network') 1440 if value is not None and 'network' not in already_processed: 1441 already_processed.append('network') 1442 self.network = value 1443 value = attrs.get('vocabulary') 1444 if value is not None and 'vocabulary' not in already_processed: 1445 already_processed.append('vocabulary') 1446 self.vocabulary = value
1447 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1448 pass
1449 # end class parentID 1450 1451
1452 -class relatedID(GeneratedsSuper):
1453 """Child or other relationships can be encoded using the related 1454 element.""" 1455 subclass = None 1456 superclass = None
1457 - def __init__(self, default=None, network=None, vocabulary=None, valueOf_=None):
1458 self.default = _cast(bool, default) 1459 self.network = _cast(None, network) 1460 self.vocabulary = _cast(None, vocabulary) 1461 self.valueOf_ = valueOf_
1462 - def factory(*args_, **kwargs_):
1463 if relatedID.subclass: 1464 return relatedID.subclass(*args_, **kwargs_) 1465 else: 1466 return relatedID(*args_, **kwargs_)
1467 factory = staticmethod(factory)
1468 - def get_default(self): return self.default
1469 - def set_default(self, default): self.default = default
1470 - def get_network(self): return self.network
1471 - def set_network(self, network): self.network = network
1472 - def get_vocabulary(self): return self.vocabulary
1473 - def set_vocabulary(self, vocabulary): self.vocabulary = vocabulary
1474 - def get_valueOf_(self): return self.valueOf_
1475 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
1476 - def export(self, outfile, level, namespace_='', name_='relatedID', namespacedef_=''):
1477 showIndent(outfile, level) 1478 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1479 self.exportAttributes(outfile, level, [], namespace_, name_='relatedID') 1480 if self.hasContent_(): 1481 outfile.write('>') 1482 outfile.write(self.valueOf_) 1483 self.exportChildren(outfile, level + 1, namespace_, name_) 1484 outfile.write('</%s%s>\n' % (namespace_, name_)) 1485 else: 1486 outfile.write('/>\n')
1487 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='relatedID'):
1488 if self.default is not None and 'default' not in already_processed: 1489 already_processed.append('default') 1490 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default')) 1491 if self.network is not None and 'network' not in already_processed: 1492 already_processed.append('network') 1493 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), )) 1494 if self.vocabulary is not None and 'vocabulary' not in already_processed: 1495 already_processed.append('vocabulary') 1496 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
1497 - def exportChildren(self, outfile, level, namespace_='', name_='relatedID'):
1498 pass
1499 - def hasContent_(self):
1500 if ( 1501 self.valueOf_ 1502 ): 1503 return True 1504 else: 1505 return False
1506 - def exportLiteral(self, outfile, level, name_='relatedID'):
1507 level += 1 1508 self.exportLiteralAttributes(outfile, level, [], name_) 1509 if self.hasContent_(): 1510 self.exportLiteralChildren(outfile, level, name_) 1511 showIndent(outfile, level) 1512 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
1513 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1514 if self.default is not None and 'default' not in already_processed: 1515 already_processed.append('default') 1516 showIndent(outfile, level) 1517 outfile.write('default = %s,\n' % (self.default,)) 1518 if self.network is not None and 'network' not in already_processed: 1519 already_processed.append('network') 1520 showIndent(outfile, level) 1521 outfile.write('network = "%s",\n' % (self.network,)) 1522 if self.vocabulary is not None and 'vocabulary' not in already_processed: 1523 already_processed.append('vocabulary') 1524 showIndent(outfile, level) 1525 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
1526 - def exportLiteralChildren(self, outfile, level, name_):
1527 pass
1528 - def build(self, node):
1529 self.buildAttributes(node, node.attrib, []) 1530 self.valueOf_ = get_all_text_(node) 1531 for child in node: 1532 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1533 self.buildChildren(child, nodeName_)
1534 - def buildAttributes(self, node, attrs, already_processed):
1535 value = attrs.get('default') 1536 if value is not None and 'default' not in already_processed: 1537 already_processed.append('default') 1538 if value in ('true', '1'): 1539 self.default = True 1540 elif value in ('false', '0'): 1541 self.default = False 1542 else: 1543 raise_parse_error(node, 'Bad boolean attribute') 1544 value = attrs.get('network') 1545 if value is not None and 'network' not in already_processed: 1546 already_processed.append('network') 1547 self.network = value 1548 value = attrs.get('vocabulary') 1549 if value is not None and 'vocabulary' not in already_processed: 1550 already_processed.append('vocabulary') 1551 self.vocabulary = value
1552 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1553 pass
1554 # end class relatedID 1555 1556
1557 -class timeSupport(GeneratedsSuper):
1558 """Element containing the time support (or temporal footprint) of the 1559 data values. @isRegular indicates if the spacing is regular. In 1560 waterML 1.0, there is a divergence of mean between ODM, and 1561 WaterML. WaterML only communcates the regularity, and the 1562 spacing of the observations (timeInterval). Whereas timesupport 1563 in the ODM is associated with the dataType, and time support. 1564 This will be addressed in 1.1 0 is used to indicate data values 1565 that are instantaneous. Other values indicate the time over 1566 which the data values are implicitly or explicitly averaged or 1567 aggregated. The default for the TimeSupport field is 0. This 1568 corresponds to instantaneous values. If the TimeSupport field is 1569 set to a value other than 0, an appropriate TimeUnitsID must be 1570 specified. The TimeUnitsID field can only reference valid 1571 UnitsID values from the Units controlled vocabulary table. If 1572 the TimeSupport field is set to 0, any time units can be used 1573 (i.e., seconds, minutes, hours, etc.), however a default value 1574 of 103 has been used, which corresponds with hours""" 1575 subclass = None 1576 superclass = None
1577 - def __init__(self, isRegular=None, unit=None, timeInterval=None):
1578 self.isRegular = _cast(bool, isRegular) 1579 self.unit = unit 1580 self.timeInterval = timeInterval
1581 - def factory(*args_, **kwargs_):
1582 if timeSupport.subclass: 1583 return timeSupport.subclass(*args_, **kwargs_) 1584 else: 1585 return timeSupport(*args_, **kwargs_)
1586 factory = staticmethod(factory)
1587 - def get_unit(self): return self.unit
1588 - def set_unit(self, unit): self.unit = unit
1589 - def get_timeInterval(self): return self.timeInterval
1590 - def set_timeInterval(self, timeInterval): self.timeInterval = timeInterval
1591 - def get_isRegular(self): return self.isRegular
1592 - def set_isRegular(self, isRegular): self.isRegular = isRegular
1593 - def export(self, outfile, level, namespace_='', name_='timeSupport', namespacedef_=''):
1594 showIndent(outfile, level) 1595 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1596 self.exportAttributes(outfile, level, [], namespace_, name_='timeSupport') 1597 if self.hasContent_(): 1598 outfile.write('>\n') 1599 self.exportChildren(outfile, level + 1, namespace_, name_) 1600 showIndent(outfile, level) 1601 outfile.write('</%s%s>\n' % (namespace_, name_)) 1602 else: 1603 outfile.write('/>\n')
1604 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeSupport'):
1605 if self.isRegular is not None and 'isRegular' not in already_processed: 1606 already_processed.append('isRegular') 1607 outfile.write(' isRegular="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.isRegular)), input_name='isRegular'))
1608 - def exportChildren(self, outfile, level, namespace_='', name_='timeSupport'):
1609 if self.unit: 1610 self.unit.export(outfile, level, namespace_, name_='unit') 1611 #TODO: Why is an empty element being exported when in ODM the value for time support is 0? 1612 if self.timeInterval is not None: 1613 showIndent(outfile, level) 1614 outfile.write('<%stimeInterval>%s</%stimeInterval>\n' % (namespace_, self.gds_format_string(quote_xml(self.timeInterval).encode(ExternalEncoding), input_name='timeInterval'), namespace_))
1615 - def hasContent_(self):
1616 if ( 1617 self.unit is not None or 1618 self.timeInterval is not None 1619 ): 1620 return True 1621 else: 1622 return False
1623 - def exportLiteral(self, outfile, level, name_='timeSupport'):
1624 level += 1 1625 self.exportLiteralAttributes(outfile, level, [], name_) 1626 if self.hasContent_(): 1627 self.exportLiteralChildren(outfile, level, name_)
1628 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1629 if self.isRegular is not None and 'isRegular' not in already_processed: 1630 already_processed.append('isRegular') 1631 showIndent(outfile, level) 1632 outfile.write('isRegular = %s,\n' % (self.isRegular,))
1633 - def exportLiteralChildren(self, outfile, level, name_):
1634 if self.unit is not None: 1635 showIndent(outfile, level) 1636 outfile.write('unit=model_.UnitsType(\n') 1637 self.unit.exportLiteral(outfile, level, name_='unit') 1638 showIndent(outfile, level) 1639 outfile.write('),\n') 1640 if self.timeInterval is not None: 1641 showIndent(outfile, level) 1642 outfile.write('timeInterval=%s,\n' % quote_python(self.timeInterval).encode(ExternalEncoding))
1643 - def build(self, node):
1644 self.buildAttributes(node, node.attrib, []) 1645 for child in node: 1646 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1647 self.buildChildren(child, nodeName_)
1648 - def buildAttributes(self, node, attrs, already_processed):
1649 value = attrs.get('isRegular') 1650 if value is not None and 'isRegular' not in already_processed: 1651 already_processed.append('isRegular') 1652 if value in ('true', '1'): 1653 self.isRegular = True 1654 elif value in ('false', '0'): 1655 self.isRegular = False 1656 else: 1657 raise_parse_error(node, 'Bad boolean attribute')
1658 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1659 if nodeName_ == 'unit': 1660 obj_ = UnitsType.factory() 1661 obj_.build(child_) 1662 self.set_unit(obj_) 1663 elif nodeName_ == 'timeInterval': 1664 timeInterval_ = child_.text 1665 self.timeInterval = timeInterval_
1666 # end class timeSupport 1667 1668
1669 -class QueryInfoType(GeneratedsSuper):
1670 """This contains information about the request, and is used to enable 1671 the XML responses (timeSeriesResponse, 1672 variablesResponse,siteResponse) to be stored on disk.""" 1673 subclass = None 1674 superclass = None
1675 - def __init__(self, creationTime=None, queryURL=None, querySQL=None, criteria=None, note=None, extension=None):
1676 self.creationTime = creationTime 1677 self.queryURL = queryURL 1678 self.querySQL = querySQL 1679 self.criteria = criteria 1680 if note is None: 1681 self.note = [] 1682 else: 1683 self.note = note 1684 self.extension = extension
1685 - def factory(*args_, **kwargs_):
1686 if QueryInfoType.subclass: 1687 return QueryInfoType.subclass(*args_, **kwargs_) 1688 else: 1689 return QueryInfoType(*args_, **kwargs_)
1690 factory = staticmethod(factory)
1691 - def get_creationTime(self): return self.creationTime
1692 - def set_creationTime(self, creationTime): self.creationTime = creationTime
1693 - def get_queryURL(self): return self.queryURL
1694 - def set_queryURL(self, queryURL): self.queryURL = queryURL
1695 - def get_querySQL(self): return self.querySQL
1696 - def set_querySQL(self, querySQL): self.querySQL = querySQL
1697 - def get_criteria(self): return self.criteria
1698 - def set_criteria(self, criteria): self.criteria = criteria
1699 - def get_note(self): return self.note
1700 - def set_note(self, note): self.note = note
1701 - def add_note(self, value): self.note.append(value)
1702 - def insert_note(self, index, value): self.note[index] = value
1703 - def get_extension(self): return self.extension
1704 - def set_extension(self, extension): self.extension = extension
1705 - def export(self, outfile, level, namespace_='', name_='QueryInfoType', namespacedef_=''):
1706 showIndent(outfile, level) 1707 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1708 self.exportAttributes(outfile, level, [], namespace_, name_='QueryInfoType') 1709 if self.hasContent_(): 1710 outfile.write('>\n') 1711 self.exportChildren(outfile, level + 1, namespace_, name_) 1712 showIndent(outfile, level) 1713 outfile.write('</%s%s>\n' % (namespace_, name_)) 1714 else: 1715 outfile.write('/>\n')
1716 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QueryInfoType'):
1717 pass
1718 - def exportChildren(self, outfile, level, namespace_='', name_='QueryInfoType'):
1719 if self.creationTime is not None: 1720 showIndent(outfile, level) 1721 outfile.write('<%screationTime>%s</%screationTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.creationTime).encode(ExternalEncoding), input_name='creationTime'), namespace_)) 1722 if self.queryURL is not None: 1723 showIndent(outfile, level) 1724 outfile.write('<%squeryURL>%s</%squeryURL>\n' % (namespace_, self.gds_format_string(quote_xml(self.queryURL).encode(ExternalEncoding), input_name='queryURL'), namespace_)) 1725 if self.querySQL is not None: 1726 showIndent(outfile, level) 1727 outfile.write('<%squerySQL>%s</%squerySQL>\n' % (namespace_, self.gds_format_string(quote_xml(self.querySQL).encode(ExternalEncoding), input_name='querySQL'), namespace_)) 1728 if self.criteria: 1729 self.criteria.export(outfile, level, namespace_, name_='criteria') 1730 for note_ in self.note: 1731 note_.export(outfile, level, namespace_, name_='note') 1732 if self.extension is not None: 1733 showIndent(outfile, level) 1734 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
1735 - def hasContent_(self):
1736 if ( 1737 self.creationTime is not None or 1738 self.queryURL is not None or 1739 self.querySQL is not None or 1740 self.criteria is not None or 1741 self.note or 1742 self.extension is not None 1743 ): 1744 return True 1745 else: 1746 return False
1747 - def exportLiteral(self, outfile, level, name_='QueryInfoType'):
1748 level += 1 1749 self.exportLiteralAttributes(outfile, level, [], name_) 1750 if self.hasContent_(): 1751 self.exportLiteralChildren(outfile, level, name_)
1752 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1753 pass
1754 - def exportLiteralChildren(self, outfile, level, name_):
1755 if self.creationTime is not None: 1756 showIndent(outfile, level) 1757 outfile.write('creationTime=%s,\n' % quote_python(self.creationTime).encode(ExternalEncoding)) 1758 if self.queryURL is not None: 1759 showIndent(outfile, level) 1760 outfile.write('queryURL=%s,\n' % quote_python(self.queryURL).encode(ExternalEncoding)) 1761 if self.querySQL is not None: 1762 showIndent(outfile, level) 1763 outfile.write('querySQL=%s,\n' % quote_python(self.querySQL).encode(ExternalEncoding)) 1764 if self.criteria is not None: 1765 showIndent(outfile, level) 1766 outfile.write('criteria=model_.criteria(\n') 1767 self.criteria.exportLiteral(outfile, level) 1768 showIndent(outfile, level) 1769 outfile.write('),\n') 1770 showIndent(outfile, level) 1771 outfile.write('note=[\n') 1772 level += 1 1773 for note_ in self.note: 1774 showIndent(outfile, level) 1775 outfile.write('model_.NoteType(\n') 1776 note_.exportLiteral(outfile, level, name_='NoteType') 1777 showIndent(outfile, level) 1778 outfile.write('),\n') 1779 level -= 1 1780 showIndent(outfile, level) 1781 outfile.write('],\n') 1782 if self.extension is not None: 1783 showIndent(outfile, level) 1784 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
1785 - def build(self, node):
1786 self.buildAttributes(node, node.attrib, []) 1787 for child in node: 1788 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1789 self.buildChildren(child, nodeName_)
1790 - def buildAttributes(self, node, attrs, already_processed):
1791 pass
1792 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1793 if nodeName_ == 'creationTime': 1794 creationTime_ = child_.text 1795 self.creationTime = creationTime_ 1796 elif nodeName_ == 'queryURL': 1797 queryURL_ = child_.text 1798 self.queryURL = queryURL_ 1799 elif nodeName_ == 'querySQL': 1800 querySQL_ = child_.text 1801 self.querySQL = querySQL_ 1802 elif nodeName_ == 'criteria': 1803 obj_ = criteria.factory() 1804 obj_.build(child_) 1805 self.set_criteria(obj_) 1806 elif nodeName_ == 'note': 1807 obj_ = NoteType.factory() 1808 obj_.build(child_) 1809 self.note.append(obj_) 1810 elif nodeName_ == 'extension': 1811 extension_ = child_.text 1812 self.extension = extension_
1813 # end class QueryInfoType 1814 1815
1816 -class criteria(GeneratedsSuper):
1817 """The criteria are the actual parameters that are passed into the 1818 method. If you are generate this without a XML helper class, be 1819 sure to properly encode these elements.""" 1820 subclass = None 1821 superclass = None
1822 - def __init__(self, locationParam=None, variableParam=None, timeParam=None):
1823 self.locationParam = locationParam 1824 self.variableParam = variableParam 1825 self.timeParam = timeParam
1826 - def factory(*args_, **kwargs_):
1827 if criteria.subclass: 1828 return criteria.subclass(*args_, **kwargs_) 1829 else: 1830 return criteria(*args_, **kwargs_)
1831 factory = staticmethod(factory)
1832 - def get_locationParam(self): return self.locationParam
1833 - def set_locationParam(self, locationParam): self.locationParam = locationParam
1834 - def get_variableParam(self): return self.variableParam
1835 - def set_variableParam(self, variableParam): self.variableParam = variableParam
1836 - def get_timeParam(self): return self.timeParam
1837 - def set_timeParam(self, timeParam): self.timeParam = timeParam
1838 - def export(self, outfile, level, namespace_='', name_='criteria', namespacedef_=''):
1839 showIndent(outfile, level) 1840 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1841 self.exportAttributes(outfile, level, [], namespace_, name_='criteria') 1842 if self.hasContent_(): 1843 outfile.write('>\n') 1844 self.exportChildren(outfile, level + 1, namespace_, name_) 1845 showIndent(outfile, level) 1846 outfile.write('</%s%s>\n' % (namespace_, name_)) 1847 else: 1848 outfile.write('/>\n')
1849 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='criteria'):
1850 pass
1851 - def exportChildren(self, outfile, level, namespace_='', name_='criteria'):
1852 if self.locationParam is not None: 1853 showIndent(outfile, level) 1854 outfile.write('<%slocationParam>%s</%slocationParam>\n' % (namespace_, self.gds_format_string(quote_xml(self.locationParam).encode(ExternalEncoding), input_name='locationParam'), namespace_)) 1855 if self.variableParam is not None: 1856 showIndent(outfile, level) 1857 outfile.write('<%svariableParam>%s</%svariableParam>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableParam).encode(ExternalEncoding), input_name='variableParam'), namespace_)) 1858 if self.timeParam: 1859 self.timeParam.export(outfile, level, namespace_, name_='timeParam')
1860 - def hasContent_(self):
1861 if ( 1862 self.locationParam is not None or 1863 self.variableParam is not None or 1864 self.timeParam is not None 1865 ): 1866 return True 1867 else: 1868 return False
1869 - def exportLiteral(self, outfile, level, name_='criteria'):
1870 level += 1 1871 self.exportLiteralAttributes(outfile, level, [], name_) 1872 if self.hasContent_(): 1873 self.exportLiteralChildren(outfile, level, name_)
1874 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1875 pass
1876 - def exportLiteralChildren(self, outfile, level, name_):
1877 if self.locationParam is not None: 1878 showIndent(outfile, level) 1879 outfile.write('locationParam=%s,\n' % quote_python(self.locationParam).encode(ExternalEncoding)) 1880 if self.variableParam is not None: 1881 showIndent(outfile, level) 1882 outfile.write('variableParam=%s,\n' % quote_python(self.variableParam).encode(ExternalEncoding)) 1883 if self.timeParam is not None: 1884 showIndent(outfile, level) 1885 outfile.write('timeParam=model_.timeParam(\n') 1886 self.timeParam.exportLiteral(outfile, level) 1887 showIndent(outfile, level) 1888 outfile.write('),\n')
1889 - def build(self, node):
1890 self.buildAttributes(node, node.attrib, []) 1891 for child in node: 1892 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1893 self.buildChildren(child, nodeName_)
1894 - def buildAttributes(self, node, attrs, already_processed):
1895 pass
1896 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1897 if nodeName_ == 'locationParam': 1898 locationParam_ = child_.text 1899 self.locationParam = locationParam_ 1900 elif nodeName_ == 'variableParam': 1901 variableParam_ = child_.text 1902 self.variableParam = variableParam_ 1903 elif nodeName_ == 'timeParam': 1904 obj_ = timeParam.factory() 1905 obj_.build(child_) 1906 self.set_timeParam(obj_)
1907 # end class criteria 1908 1909
1910 -class timeParam(GeneratedsSuper):
1911 """the begin and end time of the GetValues request used to generate a 1912 timeSeriesResponse.""" 1913 subclass = None 1914 superclass = None
1915 - def __init__(self, beginDateTime=None, endDateTime=None):
1916 self.beginDateTime = beginDateTime 1917 self.endDateTime = endDateTime
1918 - def factory(*args_, **kwargs_):
1919 if timeParam.subclass: 1920 return timeParam.subclass(*args_, **kwargs_) 1921 else: 1922 return timeParam(*args_, **kwargs_)
1923 factory = staticmethod(factory)
1924 - def get_beginDateTime(self): return self.beginDateTime
1925 - def set_beginDateTime(self, beginDateTime): self.beginDateTime = beginDateTime
1926 - def get_endDateTime(self): return self.endDateTime
1927 - def set_endDateTime(self, endDateTime): self.endDateTime = endDateTime
1928 - def export(self, outfile, level, namespace_='', name_='timeParam', namespacedef_=''):
1929 showIndent(outfile, level) 1930 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1931 self.exportAttributes(outfile, level, [], namespace_, name_='timeParam') 1932 if self.hasContent_(): 1933 outfile.write('>\n') 1934 self.exportChildren(outfile, level + 1, namespace_, name_) 1935 showIndent(outfile, level) 1936 outfile.write('</%s%s>\n' % (namespace_, name_)) 1937 else: 1938 outfile.write('/>\n')
1939 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeParam'):
1940 pass
1941 - def exportChildren(self, outfile, level, namespace_='', name_='timeParam'):
1942 if self.beginDateTime is not None: 1943 showIndent(outfile, level) 1944 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_)) 1945 if self.endDateTime is not None: 1946 showIndent(outfile, level) 1947 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
1948 - def hasContent_(self):
1949 if ( 1950 self.beginDateTime is not None or 1951 self.endDateTime is not None 1952 ): 1953 return True 1954 else: 1955 return False
1956 - def exportLiteral(self, outfile, level, name_='timeParam'):
1957 level += 1 1958 self.exportLiteralAttributes(outfile, level, [], name_) 1959 if self.hasContent_(): 1960 self.exportLiteralChildren(outfile, level, name_)
1961 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1962 pass
1963 - def exportLiteralChildren(self, outfile, level, name_):
1964 if self.beginDateTime is not None: 1965 showIndent(outfile, level) 1966 outfile.write('beginDateTime=%s,\n' % quote_python(self.beginDateTime).encode(ExternalEncoding)) 1967 if self.endDateTime is not None: 1968 showIndent(outfile, level) 1969 outfile.write('endDateTime=%s,\n' % quote_python(self.endDateTime).encode(ExternalEncoding))
1970 - def build(self, node):
1971 self.buildAttributes(node, node.attrib, []) 1972 for child in node: 1973 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1974 self.buildChildren(child, nodeName_)
1975 - def buildAttributes(self, node, attrs, already_processed):
1976 pass
1977 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1978 if nodeName_ == 'beginDateTime': 1979 beginDateTime_ = child_.text 1980 self.beginDateTime = beginDateTime_ 1981 elif nodeName_ == 'endDateTime': 1982 endDateTime_ = child_.text 1983 self.endDateTime = endDateTime_
1984 # end class timeParam 1985 1986
1987 -class variables(GeneratedsSuper):
1988 """variables is a list of variable elements (VariableInfoType).""" 1989 subclass = None 1990 superclass = None
1991 - def __init__(self, variable=None):
1992 if variable is None: 1993 self.variable = [] 1994 else: 1995 self.variable = variable
1996 - def factory(*args_, **kwargs_):
1997 if variables.subclass: 1998 return variables.subclass(*args_, **kwargs_) 1999 else: 2000 return variables(*args_, **kwargs_)
2001 factory = staticmethod(factory)
2002 - def get_variable(self): return self.variable
2003 - def set_variable(self, variable): self.variable = variable
2004 - def add_variable(self, value): self.variable.append(value)
2005 - def insert_variable(self, index, value): self.variable[index] = value
2006 - def export(self, outfile, level, namespace_='', name_='variables', namespacedef_=''):
2007 showIndent(outfile, level) 2008 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2009 self.exportAttributes(outfile, level, [], namespace_, name_='variables') 2010 if self.hasContent_(): 2011 outfile.write('>\n') 2012 self.exportChildren(outfile, level + 1, namespace_, name_) 2013 showIndent(outfile, level) 2014 outfile.write('</%s%s>\n' % (namespace_, name_)) 2015 else: 2016 outfile.write('/>\n')
2017 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='variables'):
2018 pass
2019 - def exportChildren(self, outfile, level, namespace_='', name_='variables'):
2020 for variable_ in self.variable: 2021 variable_.export(outfile, level, namespace_, name_='variable')
2022 - def hasContent_(self):
2023 if ( 2024 self.variable 2025 ): 2026 return True 2027 else: 2028 return False
2029 - def exportLiteral(self, outfile, level, name_='variables'):
2030 level += 1 2031 self.exportLiteralAttributes(outfile, level, [], name_) 2032 if self.hasContent_(): 2033 self.exportLiteralChildren(outfile, level, name_)
2034 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2035 pass
2036 - def exportLiteralChildren(self, outfile, level, name_):
2037 showIndent(outfile, level) 2038 outfile.write('variable=[\n') 2039 level += 1 2040 for variable_ in self.variable: 2041 showIndent(outfile, level) 2042 outfile.write('model_.VariableInfoType(\n') 2043 variable_.exportLiteral(outfile, level, name_='VariableInfoType') 2044 showIndent(outfile, level) 2045 outfile.write('),\n') 2046 level -= 1 2047 showIndent(outfile, level) 2048 outfile.write('],\n')
2049 - def build(self, node):
2050 self.buildAttributes(node, node.attrib, []) 2051 for child in node: 2052 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2053 self.buildChildren(child, nodeName_)
2054 - def buildAttributes(self, node, attrs, already_processed):
2055 pass
2056 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2057 if nodeName_ == 'variable': 2058 obj_ = VariableInfoType.factory() 2059 obj_.build(child_) 2060 self.variable.append(obj_)
2061 # end class variables 2062 2063
2064 -class timeZoneInfo(GeneratedsSuper):
2065 """The default time zone for this site (+00:00) and if this site shifts 2066 to daylight savings time (attribute: usesDaylightSavingsTime)If 2067 the location shifts it's data sources to Daylight Savings Time, 2068 this flag should be true.""" 2069 subclass = None 2070 superclass = None
2071 - def __init__(self, siteUsesDaylightSavingsTime=False, defaultTimeZone=None, daylightSavingsTimeZone=None):
2072 self.siteUsesDaylightSavingsTime = _cast(bool, siteUsesDaylightSavingsTime) 2073 self.defaultTimeZone = defaultTimeZone 2074 self.daylightSavingsTimeZone = daylightSavingsTimeZone
2075 - def factory(*args_, **kwargs_):
2076 if timeZoneInfo.subclass: 2077 return timeZoneInfo.subclass(*args_, **kwargs_) 2078 else: 2079 return timeZoneInfo(*args_, **kwargs_)
2080 factory = staticmethod(factory)
2081 - def get_defaultTimeZone(self): return self.defaultTimeZone
2082 - def set_defaultTimeZone(self, defaultTimeZone): self.defaultTimeZone = defaultTimeZone
2084 - def set_daylightSavingsTimeZone(self, daylightSavingsTimeZone): self.daylightSavingsTimeZone = daylightSavingsTimeZone
2085 - def get_siteUsesDaylightSavingsTime(self): return self.siteUsesDaylightSavingsTime
2086 - def set_siteUsesDaylightSavingsTime(self, siteUsesDaylightSavingsTime): self.siteUsesDaylightSavingsTime = siteUsesDaylightSavingsTime
2087 - def export(self, outfile, level, namespace_='', name_='timeZoneInfo', namespacedef_=''):
2088 showIndent(outfile, level) 2089 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2090 self.exportAttributes(outfile, level, [], namespace_, name_='timeZoneInfo') 2091 if self.hasContent_(): 2092 outfile.write('>\n') 2093 self.exportChildren(outfile, level + 1, namespace_, name_) 2094 showIndent(outfile, level) 2095 outfile.write('</%s%s>\n' % (namespace_, name_)) 2096 else: 2097 outfile.write('/>\n')
2098 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeZoneInfo'):
2099 if self.siteUsesDaylightSavingsTime is not None and 'siteUsesDaylightSavingsTime' not in already_processed: 2100 already_processed.append('siteUsesDaylightSavingsTime') 2101 outfile.write(' siteUsesDaylightSavingsTime="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.siteUsesDaylightSavingsTime)), input_name='siteUsesDaylightSavingsTime'))
2102 - def exportChildren(self, outfile, level, namespace_='', name_='timeZoneInfo'):
2103 if self.defaultTimeZone is not None: 2104 self.defaultTimeZone.export(outfile, level, namespace_, 'defaultTimeZone') 2105 if self.daylightSavingsTimeZone is not None: 2106 self.daylightSavingsTimeZone.export(outfile, level, namespace_, 'daylightSavingsTimeZone')
2107 - def hasContent_(self):
2108 if ( 2109 self.defaultTimeZone is not None or 2110 self.daylightSavingsTimeZone is not None 2111 ): 2112 return True 2113 else: 2114 return False
2115 - def exportLiteral(self, outfile, level, name_='timeZoneInfo'):
2116 level += 1 2117 self.exportLiteralAttributes(outfile, level, [], name_) 2118 if self.hasContent_(): 2119 self.exportLiteralChildren(outfile, level, name_)
2120 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2121 if self.siteUsesDaylightSavingsTime is not None and 'siteUsesDaylightSavingsTime' not in already_processed: 2122 already_processed.append('siteUsesDaylightSavingsTime') 2123 showIndent(outfile, level) 2124 outfile.write('siteUsesDaylightSavingsTime = %s,\n' % (self.siteUsesDaylightSavingsTime,))
2125 - def exportLiteralChildren(self, outfile, level, name_):
2126 if self.defaultTimeZone is not None: 2127 showIndent(outfile, level) 2128 outfile.write('defaultTimeZone=%s,\n' % quote_python(self.defaultTimeZone).encode(ExternalEncoding)) 2129 if self.daylightSavingsTimeZone is not None: 2130 showIndent(outfile, level) 2131 outfile.write('daylightSavingsTimeZone=%s,\n' % quote_python(self.daylightSavingsTimeZone).encode(ExternalEncoding))
2132 - def build(self, node):
2133 self.buildAttributes(node, node.attrib, []) 2134 for child in node: 2135 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2136 self.buildChildren(child, nodeName_)
2137 - def buildAttributes(self, node, attrs, already_processed):
2138 value = attrs.get('siteUsesDaylightSavingsTime') 2139 if value is not None and 'siteUsesDaylightSavingsTime' not in already_processed: 2140 already_processed.append('siteUsesDaylightSavingsTime') 2141 if value in ('true', '1'): 2142 self.siteUsesDaylightSavingsTime = True 2143 elif value in ('false', '0'): 2144 self.siteUsesDaylightSavingsTime = False 2145 else: 2146 raise_parse_error(node, 'Bad boolean attribute')
2147 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2148 if nodeName_ == 'defaultTimeZone': 2149 obj_ = xsi_string.factory() 2150 obj_.build(child_) 2151 self.set_defaultTimeZone(obj_) 2152 elif nodeName_ == 'daylightSavingsTimeZone': 2153 obj_ = xsi_string.factory() 2154 obj_.build(child_) 2155 self.set_daylightSavingsTimeZone(obj_)
2156 # end class timeZoneInfo 2157 2158
2159 -class defaultTimeZone(GeneratedsSuper):
2160 """The default time zone for a site, specified in hours and minutes: hh:mm""" 2161 subclass = None 2162 superclass = None
2163 - def __init__(self, ZoneOffset=None, ZoneAbbreviation=None, valueOf_=None):
2164 self.ZoneOffset = _cast(None, ZoneOffset) 2165 self.ZoneAbbreviation = _cast(None, ZoneAbbreviation) 2166 self.valueOf_ = valueOf_
2167 - def factory(*args_, **kwargs_):
2168 if defaultTimeZone.subclass: 2169 return defaultTimeZone.subclass(*args_, **kwargs_) 2170 else: 2171 return defaultTimeZone(*args_, **kwargs_)
2172 factory = staticmethod(factory)
2173 - def get_ZoneOffset(self): return self.ZoneOffset
2174 - def set_ZoneOffset(self, ZoneOffset): self.ZoneOffset = ZoneOffset
2175 - def get_ZoneAbbreviation(self): return self.ZoneAbbreviation
2176 - def set_ZoneAbbreviation(self, ZoneAbbreviation): self.ZoneAbbreviation = ZoneAbbreviation
2177 - def get_valueOf_(self): return self.valueOf_
2178 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2179 - def export(self, outfile, level, namespace_='', name_='defaultTimeZone', namespacedef_=''):
2180 showIndent(outfile, level) 2181 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2182 self.exportAttributes(outfile, level, [], namespace_, name_='defaultTimeZone') 2183 if self.hasContent_(): 2184 outfile.write('>') 2185 outfile.write(self.valueOf_) 2186 self.exportChildren(outfile, level + 1, namespace_, name_) 2187 outfile.write('</%s%s>\n' % (namespace_, name_)) 2188 else: 2189 outfile.write('/>\n')
2190 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='defaultTimeZone'):
2191 outfile.write(' ZoneOffset=%s' % (self.gds_format_string(quote_attrib(self.ZoneOffset).encode(ExternalEncoding), input_name='ZoneOffset'), )) 2192 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed: 2193 already_processed.append('ZoneAbbreviation') 2194 outfile.write(' ZoneAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.ZoneAbbreviation).encode(ExternalEncoding), input_name='ZoneAbbreviation'), ))
2195 - def exportChildren(self, outfile, level, namespace_='', name_='defaultTimeZone'):
2196 pass
2197 - def hasContent_(self):
2198 if ( 2199 self.valueOf_ 2200 ): 2201 return True 2202 else: 2203 return False
2204 - def exportLiteral(self, outfile, level, name_='defaultTimeZone'):
2205 level += 1 2206 self.exportLiteralAttributes(outfile, level, [], name_) 2207 if self.hasContent_(): 2208 self.exportLiteralChildren(outfile, level, name_) 2209 showIndent(outfile, level) 2210 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
2211 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2212 if self.ZoneOffset is not None and 'ZoneOffset' not in already_processed: 2213 already_processed.append('ZoneOffset') 2214 showIndent(outfile, level) 2215 outfile.write('ZoneOffset = "%s",\n' % (self.ZoneOffset,)) 2216 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed: 2217 already_processed.append('ZoneAbbreviation') 2218 showIndent(outfile, level) 2219 outfile.write('ZoneAbbreviation = "%s",\n' % (self.ZoneAbbreviation,))
2220 - def exportLiteralChildren(self, outfile, level, name_):
2221 pass
2222 - def build(self, node):
2223 self.buildAttributes(node, node.attrib, []) 2224 self.valueOf_ = get_all_text_(node) 2225 for child in node: 2226 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2227 self.buildChildren(child, nodeName_)
2228 - def buildAttributes(self, node, attrs, already_processed):
2229 value = attrs.get('ZoneOffset') 2230 if value is not None and 'ZoneOffset' not in already_processed: 2231 already_processed.append('ZoneOffset') 2232 self.ZoneOffset = value 2233 value = attrs.get('ZoneAbbreviation') 2234 if value is not None and 'ZoneAbbreviation' not in already_processed: 2235 already_processed.append('ZoneAbbreviation') 2236 self.ZoneAbbreviation = value
2237 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2238 pass
2239 # end class defaultTimeZone 2240 2241
2242 -class daylightSavingsTimeZone(GeneratedsSuper):
2243 """The daylight savings time zone for a site, specified in hours and 2244 minutes: hh:mm""" 2245 subclass = None 2246 superclass = None
2247 - def __init__(self, ZoneOffset=None, ZoneAbbreviation=None, valueOf_=None):
2248 self.ZoneOffset = _cast(None, ZoneOffset) 2249 self.ZoneAbbreviation = _cast(None, ZoneAbbreviation) 2250 self.valueOf_ = valueOf_
2251 - def factory(*args_, **kwargs_):
2252 if daylightSavingsTimeZone.subclass: 2253 return daylightSavingsTimeZone.subclass(*args_, **kwargs_) 2254 else: 2255 return daylightSavingsTimeZone(*args_, **kwargs_)
2256 factory = staticmethod(factory)
2257 - def get_ZoneOffset(self): return self.ZoneOffset
2258 - def set_ZoneOffset(self, ZoneOffset): self.ZoneOffset = ZoneOffset
2259 - def get_ZoneAbbreviation(self): return self.ZoneAbbreviation
2260 - def set_ZoneAbbreviation(self, ZoneAbbreviation): self.ZoneAbbreviation = ZoneAbbreviation
2261 - def get_valueOf_(self): return self.valueOf_
2262 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2263 - def export(self, outfile, level, namespace_='', name_='daylightSavingsTimeZone', namespacedef_=''):
2264 showIndent(outfile, level) 2265 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2266 self.exportAttributes(outfile, level, [], namespace_, name_='daylightSavingsTimeZone') 2267 if self.hasContent_(): 2268 outfile.write('>') 2269 outfile.write(self.valueOf_) 2270 self.exportChildren(outfile, level + 1, namespace_, name_) 2271 outfile.write('</%s%s>\n' % (namespace_, name_)) 2272 else: 2273 outfile.write('/>\n')
2274 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='daylightSavingsTimeZone'):
2275 outfile.write(' ZoneOffset=%s' % (self.gds_format_string(quote_attrib(self.ZoneOffset).encode(ExternalEncoding), input_name='ZoneOffset'), )) 2276 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed: 2277 already_processed.append('ZoneAbbreviation') 2278 outfile.write(' ZoneAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.ZoneAbbreviation).encode(ExternalEncoding), input_name='ZoneAbbreviation'), ))
2279 - def exportChildren(self, outfile, level, namespace_='', name_='daylightSavingsTimeZone'):
2280 pass
2281 - def hasContent_(self):
2282 if ( 2283 self.valueOf_ 2284 ): 2285 return True 2286 else: 2287 return False
2288 - def exportLiteral(self, outfile, level, name_='daylightSavingsTimeZone'):
2289 level += 1 2290 self.exportLiteralAttributes(outfile, level, [], name_) 2291 if self.hasContent_(): 2292 self.exportLiteralChildren(outfile, level, name_) 2293 showIndent(outfile, level) 2294 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
2295 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2296 if self.ZoneOffset is not None and 'ZoneOffset' not in already_processed: 2297 already_processed.append('ZoneOffset') 2298 showIndent(outfile, level) 2299 outfile.write('ZoneOffset = "%s",\n' % (self.ZoneOffset,)) 2300 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed: 2301 already_processed.append('ZoneAbbreviation') 2302 showIndent(outfile, level) 2303 outfile.write('ZoneAbbreviation = "%s",\n' % (self.ZoneAbbreviation,))
2304 - def exportLiteralChildren(self, outfile, level, name_):
2305 pass
2306 - def build(self, node):
2307 self.buildAttributes(node, node.attrib, []) 2308 self.valueOf_ = get_all_text_(node) 2309 for child in node: 2310 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2311 self.buildChildren(child, nodeName_)
2312 - def buildAttributes(self, node, attrs, already_processed):
2313 value = attrs.get('ZoneOffset') 2314 if value is not None and 'ZoneOffset' not in already_processed: 2315 already_processed.append('ZoneOffset') 2316 self.ZoneOffset = value 2317 value = attrs.get('ZoneAbbreviation') 2318 if value is not None and 'ZoneAbbreviation' not in already_processed: 2319 already_processed.append('ZoneAbbreviation') 2320 self.ZoneAbbreviation = value
2321 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2322 pass
2323 # end class daylightSavingsTimeZone 2324 2325
2326 -class optionGroup(GeneratedsSuper):
2327 subclass = None 2328 superclass = None
2329 - def __init__(self, option=None):
2330 if option is None: 2331 self.option = [] 2332 else: 2333 self.option = option
2334 - def factory(*args_, **kwargs_):
2335 if optionGroup.subclass: 2336 return optionGroup.subclass(*args_, **kwargs_) 2337 else: 2338 return optionGroup(*args_, **kwargs_)
2339 factory = staticmethod(factory)
2340 - def get_option(self): return self.option
2341 - def set_option(self, option): self.option = option
2342 - def add_option(self, value): self.option.append(value)
2343 - def insert_option(self, index, value): self.option[index] = value
2344 - def export(self, outfile, level, namespace_='', name_='optionGroup', namespacedef_=''):
2345 showIndent(outfile, level) 2346 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2347 self.exportAttributes(outfile, level, [], namespace_, name_='optionGroup') 2348 if self.hasContent_(): 2349 outfile.write('>\n') 2350 self.exportChildren(outfile, level + 1, namespace_, name_) 2351 showIndent(outfile, level) 2352 outfile.write('</%s%s>\n' % (namespace_, name_)) 2353 else: 2354 outfile.write('/>\n')
2355 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='optionGroup'):
2356 pass
2357 - def exportChildren(self, outfile, level, namespace_='', name_='optionGroup'):
2358 for option_ in self.option: 2359 option_.export(outfile, level, namespace_, name_='option')
2360 - def hasContent_(self):
2361 if ( 2362 self.option 2363 ): 2364 return True 2365 else: 2366 return False
2367 - def exportLiteral(self, outfile, level, name_='optionGroup'):
2368 level += 1 2369 self.exportLiteralAttributes(outfile, level, [], name_) 2370 if self.hasContent_(): 2371 self.exportLiteralChildren(outfile, level, name_)
2372 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2373 pass
2374 - def exportLiteralChildren(self, outfile, level, name_):
2375 showIndent(outfile, level) 2376 outfile.write('option=[\n') 2377 level += 1 2378 for option_ in self.option: 2379 showIndent(outfile, level) 2380 outfile.write('model_.option(\n') 2381 option_.exportLiteral(outfile, level) 2382 showIndent(outfile, level) 2383 outfile.write('),\n') 2384 level -= 1 2385 showIndent(outfile, level) 2386 outfile.write('],\n')
2387 - def build(self, node):
2388 self.buildAttributes(node, node.attrib, []) 2389 for child in node: 2390 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2391 self.buildChildren(child, nodeName_)
2392 - def buildAttributes(self, node, attrs, already_processed):
2393 pass
2394 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2395 if nodeName_ == 'option': 2396 obj_ = option.factory() 2397 obj_.build(child_) 2398 self.option.append(obj_)
2399 # end class optionGroup 2400 2401
2402 -class DocumentationType(GeneratedsSuper):
2403 subclass = None 2404 superclass = None
2405 - def __init__(self, title=None, href=None, type_=None, show=None, valueOf_=None, mixedclass_=None, content_=None):
2406 self.title = _cast(None, title) 2407 self.href = _cast(None, href) 2408 self.type_ = _cast(None, type_) 2409 self.show = _cast(None, show) 2410 self.valueOf_ = valueOf_ 2411 if mixedclass_ is None: 2412 self.mixedclass_ = MixedContainer 2413 else: 2414 self.mixedclass_ = mixedclass_ 2415 if content_ is None: 2416 self.content_ = [] 2417 else: 2418 self.content_ = content_ 2419 self.valueOf_ = valueOf_
2420 - def factory(*args_, **kwargs_):
2421 if DocumentationType.subclass: 2422 return DocumentationType.subclass(*args_, **kwargs_) 2423 else: 2424 return DocumentationType(*args_, **kwargs_)
2425 factory = staticmethod(factory)
2426 - def get_title(self): return self.title
2427 - def set_title(self, title): self.title = title
2428 - def get_href(self): return self.href
2429 - def set_href(self, href): self.href = href
2430 - def get_type(self): return self.type_
2431 - def set_type(self, type_): self.type_ = type_
2432 - def validate_DocumentationEnumTypes(self, value):
2433 # Validate type DocumentationEnumTypes, a restriction on xsi:token. 2434 pass
2435 - def get_show(self): return self.show
2436 - def set_show(self, show): self.show = show
2437 - def get_valueOf_(self): return self.valueOf_
2438 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2439 - def export(self, outfile, level, namespace_='', name_='DocumentationType', namespacedef_=''):
2440 showIndent(outfile, level) 2441 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2442 self.exportAttributes(outfile, level, [], namespace_, name_='DocumentationType') 2443 outfile.write('>') 2444 self.exportChildren(outfile, level + 1, namespace_, name_) 2445 outfile.write('</%s%s>\n' % (namespace_, name_))
2446 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DocumentationType'):
2447 if self.title is not None and 'title' not in already_processed: 2448 already_processed.append('title') 2449 outfile.write(' title=%s' % (self.gds_format_string(quote_attrib(self.title).encode(ExternalEncoding), input_name='title'), )) 2450 if self.href is not None and 'href' not in already_processed: 2451 already_processed.append('href') 2452 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), )) 2453 if self.type_ is not None and 'type_' not in already_processed: 2454 already_processed.append('type_') 2455 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 2456 if self.show is not None and 'show' not in already_processed: 2457 already_processed.append('show') 2458 outfile.write(' show=%s' % (self.gds_format_string(quote_attrib(self.show).encode(ExternalEncoding), input_name='show'), ))
2459 - def exportChildren(self, outfile, level, namespace_='', name_='DocumentationType'):
2460 pass
2461 - def hasContent_(self):
2462 if ( 2463 self.valueOf_ 2464 ): 2465 return True 2466 else: 2467 return False
2468 - def exportLiteral(self, outfile, level, name_='DocumentationType'):
2469 level += 1 2470 self.exportLiteralAttributes(outfile, level, [], name_) 2471 if self.hasContent_(): 2472 self.exportLiteralChildren(outfile, level, name_) 2473 showIndent(outfile, level) 2474 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
2475 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2476 if self.title is not None and 'title' not in already_processed: 2477 already_processed.append('title') 2478 showIndent(outfile, level) 2479 outfile.write('title = "%s",\n' % (self.title,)) 2480 if self.href is not None and 'href' not in already_processed: 2481 already_processed.append('href') 2482 showIndent(outfile, level) 2483 outfile.write('href = "%s",\n' % (self.href,)) 2484 if self.type_ is not None and 'type_' not in already_processed: 2485 already_processed.append('type_') 2486 showIndent(outfile, level) 2487 outfile.write('type_ = "%s",\n' % (self.type_,)) 2488 if self.show is not None and 'show' not in already_processed: 2489 already_processed.append('show') 2490 showIndent(outfile, level) 2491 outfile.write('show = "%s",\n' % (self.show,))
2492 - def exportLiteralChildren(self, outfile, level, name_):
2493 pass
2494 - def build(self, node):
2495 self.buildAttributes(node, node.attrib, []) 2496 self.valueOf_ = get_all_text_(node) 2497 if node.text is not None: 2498 obj_ = self.mixedclass_(MixedContainer.CategoryText, 2499 MixedContainer.TypeNone, '', node.text) 2500 self.content_.append(obj_) 2501 for child in node: 2502 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2503 self.buildChildren(child, nodeName_)
2504 - def buildAttributes(self, node, attrs, already_processed):
2505 value = attrs.get('title') 2506 if value is not None and 'title' not in already_processed: 2507 already_processed.append('title') 2508 self.title = value 2509 value = attrs.get('href') 2510 if value is not None and 'href' not in already_processed: 2511 already_processed.append('href') 2512 self.href = value 2513 value = attrs.get('type') 2514 if value is not None and 'type' not in already_processed: 2515 already_processed.append('type') 2516 self.type_ = value 2517 self.type_ = ' '.join(self.type_.split()) 2518 value = attrs.get('show') 2519 if value is not None and 'show' not in already_processed: 2520 already_processed.append('show') 2521 self.show = value
2522 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2523 if not from_subclass and child_.tail is not None: 2524 obj_ = self.mixedclass_(MixedContainer.CategoryText, 2525 MixedContainer.TypeNone, '', child_.tail) 2526 self.content_.append(obj_) 2527 pass
2528 # end class DocumentationType 2529 2530
2531 -class options(GeneratedsSuper):
2532 """A list of options. Option elements are key-value pair elements that 2533 control how a variable maght be utilized in a service. Examples: 2534 MODIS web service. Information is aggreated over land or ocean 2535 or both. The plotarea option can include: plotarea=land, 2536 plotarea=land, plotarea=landocean USGS uses a statistic code, 2537 0003, to repesent a value type of 'Average'. The USGS statistic 2538 codes also several options that do not fit the ODM data model.""" 2539 subclass = None 2540 superclass = None
2541 - def __init__(self, option=None):
2542 if option is None: 2543 self.option = [] 2544 else: 2545 self.option = option
2546 - def factory(*args_, **kwargs_):
2547 if options.subclass: 2548 return options.subclass(*args_, **kwargs_) 2549 else: 2550 return options(*args_, **kwargs_)
2551 factory = staticmethod(factory)
2552 - def get_option(self): return self.option
2553 - def set_option(self, option): self.option = option
2554 - def add_option(self, value): self.option.append(value)
2555 - def insert_option(self, index, value): self.option[index] = value
2556 - def export(self, outfile, level, namespace_='', name_='options', namespacedef_=''):
2557 showIndent(outfile, level) 2558 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2559 self.exportAttributes(outfile, level, [], namespace_, name_='options') 2560 if self.hasContent_(): 2561 outfile.write('>\n') 2562 self.exportChildren(outfile, level + 1, namespace_, name_) 2563 showIndent(outfile, level) 2564 outfile.write('</%s%s>\n' % (namespace_, name_)) 2565 else: 2566 outfile.write('/>\n')
2567 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='options'):
2568 pass
2569 - def exportChildren(self, outfile, level, namespace_='', name_='options'):
2570 for option_ in self.option: 2571 option_.export(outfile, level, namespace_, name_='option')
2572 - def hasContent_(self):
2573 if ( 2574 self.option 2575 ): 2576 return True 2577 else: 2578 return False
2579 - def exportLiteral(self, outfile, level, name_='options'):
2580 level += 1 2581 self.exportLiteralAttributes(outfile, level, [], name_) 2582 if self.hasContent_(): 2583 self.exportLiteralChildren(outfile, level, name_)
2584 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2585 pass
2586 - def exportLiteralChildren(self, outfile, level, name_):
2587 showIndent(outfile, level) 2588 outfile.write('option=[\n') 2589 level += 1 2590 for option_ in self.option: 2591 showIndent(outfile, level) 2592 outfile.write('model_.option(\n') 2593 option_.exportLiteral(outfile, level) 2594 showIndent(outfile, level) 2595 outfile.write('),\n') 2596 level -= 1 2597 showIndent(outfile, level) 2598 outfile.write('],\n')
2599 - def build(self, node):
2600 self.buildAttributes(node, node.attrib, []) 2601 for child in node: 2602 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2603 self.buildChildren(child, nodeName_)
2604 - def buildAttributes(self, node, attrs, already_processed):
2605 pass
2606 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2607 if nodeName_ == 'option': 2608 obj_ = option.factory() 2609 obj_.build(child_) 2610 self.option.append(obj_)
2611 # end class options 2612 2613
2614 -class SourceInfoType(GeneratedsSuper):
2615 """SourceInfoType is used to describe the data source in the 2616 timeSeriesResponse. SourceInfoType is the base type for data 2617 source information. At present, two types are derived from 2618 SourceInfoType: SiteInfoType, and DataSetInfoType. SiteInfoType 2619 describes tlocation for a timeseries where that time series is 2620 located at a site or a DataSetInfoType describes time series 2621 derived from a dataset, such as a netCDF file, or a gridded 2622 model.""" 2623 subclass = None 2624 superclass = None
2625 - def __init__(self, valueOf_=None):
2626 self.valueOf_ = valueOf_
2627 - def factory(*args_, **kwargs_):
2628 if SourceInfoType.subclass: 2629 return SourceInfoType.subclass(*args_, **kwargs_) 2630 else: 2631 return SourceInfoType(*args_, **kwargs_)
2632 factory = staticmethod(factory)
2633 - def get_valueOf_(self): return self.valueOf_
2634 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2635 - def export(self, outfile, level, namespace_='', name_='SourceInfoType', namespacedef_=''):
2636 showIndent(outfile, level) 2637 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2638 self.exportAttributes(outfile, level, [], namespace_, name_='SourceInfoType') 2639 if self.hasContent_(): 2640 outfile.write('>') 2641 outfile.write(self.valueOf_) 2642 self.exportChildren(outfile, level + 1, namespace_, name_) 2643 outfile.write('</%s%s>\n' % (namespace_, name_)) 2644 else: 2645 outfile.write('/>\n')
2646 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SourceInfoType'):
2647 pass
2648 - def exportChildren(self, outfile, level, namespace_='', name_='SourceInfoType'):
2649 pass
2650 - def hasContent_(self):
2651 if ( 2652 self.valueOf_ 2653 ): 2654 return True 2655 else: 2656 return False
2657 - def exportLiteral(self, outfile, level, name_='SourceInfoType'):
2658 level += 1 2659 self.exportLiteralAttributes(outfile, level, [], name_) 2660 if self.hasContent_(): 2661 self.exportLiteralChildren(outfile, level, name_) 2662 showIndent(outfile, level) 2663 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
2664 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2665 pass
2666 - def exportLiteralChildren(self, outfile, level, name_):
2667 pass
2668 - def build(self, node):
2669 self.buildAttributes(node, node.attrib, []) 2670 self.valueOf_ = get_all_text_(node) 2671 for child in node: 2672 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2673 self.buildChildren(child, nodeName_)
2674 - def buildAttributes(self, node, attrs, already_processed):
2675 pass
2676 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2677 pass
2678 # end class SourceInfoType 2679 2680
2681 -class DataSetInfoType(SourceInfoType):
2682 """DataSetInfoType describes time series derived from a dataset, such 2683 as a netCDF file, or a gridded model.""" 2684 subclass = None 2685 superclass = SourceInfoType
2686 - def __init__(self, dataSetIdentifier=None, timeZoneInfo=None, dataSetDescription=None, note=None, dataSetLocation=None, extension=None):
2687 super(DataSetInfoType, self).__init__() 2688 self.dataSetIdentifier = dataSetIdentifier 2689 self.timeZoneInfo = timeZoneInfo 2690 self.dataSetDescription = dataSetDescription 2691 if note is None: 2692 self.note = [] 2693 else: 2694 self.note = note 2695 self.dataSetLocation = dataSetLocation 2696 self.extension = extension
2697 - def factory(*args_, **kwargs_):
2698 if DataSetInfoType.subclass: 2699 return DataSetInfoType.subclass(*args_, **kwargs_) 2700 else: 2701 return DataSetInfoType(*args_, **kwargs_)
2702 factory = staticmethod(factory)
2703 - def get_dataSetIdentifier(self): return self.dataSetIdentifier
2704 - def set_dataSetIdentifier(self, dataSetIdentifier): self.dataSetIdentifier = dataSetIdentifier
2705 - def get_timeZoneInfo(self): return self.timeZoneInfo
2706 - def set_timeZoneInfo(self, timeZoneInfo): self.timeZoneInfo = timeZoneInfo
2707 - def get_dataSetDescription(self): return self.dataSetDescription
2708 - def set_dataSetDescription(self, dataSetDescription): self.dataSetDescription = dataSetDescription
2709 - def get_note(self): return self.note
2710 - def set_note(self, note): self.note = note
2711 - def add_note(self, value): self.note.append(value)
2712 - def insert_note(self, index, value): self.note[index] = value
2713 - def get_dataSetLocation(self): return self.dataSetLocation
2714 - def set_dataSetLocation(self, dataSetLocation): self.dataSetLocation = dataSetLocation
2715 - def get_extension(self): return self.extension
2716 - def set_extension(self, extension): self.extension = extension
2717 - def export(self, outfile, level, namespace_='', name_='DataSetInfoType', namespacedef_=''):
2718 showIndent(outfile, level) 2719 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2720 self.exportAttributes(outfile, level, [], namespace_, name_='DataSetInfoType') 2721 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 2722 outfile.write(' xsi:type="DataSetInfoType"') 2723 if self.hasContent_(): 2724 outfile.write('>\n') 2725 self.exportChildren(outfile, level + 1, namespace_, name_) 2726 showIndent(outfile, level) 2727 outfile.write('</%s%s>\n' % (namespace_, name_)) 2728 else: 2729 outfile.write('/>\n')
2730 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DataSetInfoType'):
2731 super(DataSetInfoType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='DataSetInfoType')
2732 - def exportChildren(self, outfile, level, namespace_='', name_='DataSetInfoType'):
2733 super(DataSetInfoType, self).exportChildren(outfile, level, namespace_, name_) 2734 if self.dataSetIdentifier is not None: 2735 showIndent(outfile, level) 2736 outfile.write('<%sdataSetIdentifier>%s</%sdataSetIdentifier>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataSetIdentifier).encode(ExternalEncoding), input_name='dataSetIdentifier'), namespace_)) 2737 if self.timeZoneInfo: 2738 self.timeZoneInfo.export(outfile, level, namespace_, name_='timeZoneInfo') 2739 if self.dataSetDescription is not None: 2740 showIndent(outfile, level) 2741 outfile.write('<%sdataSetDescription>%s</%sdataSetDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataSetDescription).encode(ExternalEncoding), input_name='dataSetDescription'), namespace_)) 2742 for note_ in self.note: 2743 note_.export(outfile, level, namespace_, name_='note') 2744 if self.dataSetLocation: 2745 self.dataSetLocation.export(outfile, level, namespace_, name_='dataSetLocation') 2746 if self.extension is not None: 2747 showIndent(outfile, level) 2748 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
2749 - def hasContent_(self):
2750 if ( 2751 self.dataSetIdentifier is not None or 2752 self.timeZoneInfo is not None or 2753 self.dataSetDescription is not None or 2754 self.note or 2755 self.dataSetLocation is not None or 2756 self.extension is not None or 2757 super(DataSetInfoType, self).hasContent_() 2758 ): 2759 return True 2760 else: 2761 return False
2762 - def exportLiteral(self, outfile, level, name_='DataSetInfoType'):
2763 level += 1 2764 self.exportLiteralAttributes(outfile, level, [], name_) 2765 if self.hasContent_(): 2766 self.exportLiteralChildren(outfile, level, name_)
2767 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2768 super(DataSetInfoType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
2769 - def exportLiteralChildren(self, outfile, level, name_):
2770 super(DataSetInfoType, self).exportLiteralChildren(outfile, level, name_) 2771 if self.dataSetIdentifier is not None: 2772 showIndent(outfile, level) 2773 outfile.write('dataSetIdentifier=%s,\n' % quote_python(self.dataSetIdentifier).encode(ExternalEncoding)) 2774 if self.timeZoneInfo is not None: 2775 showIndent(outfile, level) 2776 outfile.write('timeZoneInfo=model_.timeZoneInfo(\n') 2777 self.timeZoneInfo.exportLiteral(outfile, level) 2778 showIndent(outfile, level) 2779 outfile.write('),\n') 2780 if self.dataSetDescription is not None: 2781 showIndent(outfile, level) 2782 outfile.write('dataSetDescription=%s,\n' % quote_python(self.dataSetDescription).encode(ExternalEncoding)) 2783 showIndent(outfile, level) 2784 outfile.write('note=[\n') 2785 level += 1 2786 for note_ in self.note: 2787 showIndent(outfile, level) 2788 outfile.write('model_.NoteType(\n') 2789 note_.exportLiteral(outfile, level, name_='NoteType') 2790 showIndent(outfile, level) 2791 outfile.write('),\n') 2792 level -= 1 2793 showIndent(outfile, level) 2794 outfile.write('],\n') 2795 if self.dataSetLocation is not None: 2796 showIndent(outfile, level) 2797 outfile.write('dataSetLocation=model_.GeogLocationType(\n') 2798 self.dataSetLocation.exportLiteral(outfile, level, name_='dataSetLocation') 2799 showIndent(outfile, level) 2800 outfile.write('),\n') 2801 if self.extension is not None: 2802 showIndent(outfile, level) 2803 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
2804 - def build(self, node):
2805 self.buildAttributes(node, node.attrib, []) 2806 for child in node: 2807 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2808 self.buildChildren(child, nodeName_)
2809 - def buildAttributes(self, node, attrs, already_processed):
2810 super(DataSetInfoType, self).buildAttributes(node, attrs, already_processed)
2811 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2812 if nodeName_ == 'dataSetIdentifier': 2813 dataSetIdentifier_ = child_.text 2814 self.dataSetIdentifier = dataSetIdentifier_ 2815 elif nodeName_ == 'timeZoneInfo': 2816 obj_ = timeZoneInfo.factory() 2817 obj_.build(child_) 2818 self.set_timeZoneInfo(obj_) 2819 elif nodeName_ == 'dataSetDescription': 2820 dataSetDescription_ = child_.text 2821 self.dataSetDescription = dataSetDescription_ 2822 elif nodeName_ == 'note': 2823 obj_ = NoteType.factory() 2824 obj_.build(child_) 2825 self.note.append(obj_) 2826 elif nodeName_ == 'dataSetLocation': 2827 obj_ = GeogLocationType.factory() 2828 obj_.build(child_) 2829 self.set_dataSetLocation(obj_) 2830 elif nodeName_ == 'extension': 2831 extension_ = child_.text 2832 self.extension = extension_ 2833 super(DataSetInfoType, self).buildChildren(child_, nodeName_, True)
2834 # end class DataSetInfoType 2835 2836
2837 -class TimePeriodType(GeneratedsSuper):
2838 """time series (site-variable-observation) can have three types of time 2839 periods: 1) definite start and end time, or TimeIntervalType, 2) 2840 single observation, or TimeSingleType 3) Real Time station with 2841 moving window of data available, or TimeRealTimeType In order to 2842 simplify client development, all types now include 2843 beginDateTime, and endDateTime. A fourth type should be added: 2844 4) continuing site, where start is known, and site is still 2845 collecting data. This could be a realTimeType, or rename the 2846 real time type to TimeDefinedPeriodType.""" 2847 subclass = None 2848 superclass = None
2849 - def __init__(self, valueOf_=None):
2850 self.valueOf_ = valueOf_
2851 - def factory(*args_, **kwargs_):
2852 if TimePeriodType.subclass: 2853 return TimePeriodType.subclass(*args_, **kwargs_) 2854 else: 2855 return TimePeriodType(*args_, **kwargs_)
2856 factory = staticmethod(factory)
2857 - def get_valueOf_(self): return self.valueOf_
2858 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2859 - def export(self, outfile, level, namespace_='', name_='TimePeriodType', namespacedef_=''):
2860 showIndent(outfile, level) 2861 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2862 self.exportAttributes(outfile, level, [], namespace_, name_='TimePeriodType') 2863 if self.hasContent_(): 2864 outfile.write('>') 2865 outfile.write(self.valueOf_) 2866 self.exportChildren(outfile, level + 1, namespace_, name_) 2867 outfile.write('</%s%s>\n' % (namespace_, name_)) 2868 else: 2869 outfile.write('/>\n')
2870 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimePeriodType'):
2871 pass
2872 - def exportChildren(self, outfile, level, namespace_='', name_='TimePeriodType'):
2873 pass
2874 - def hasContent_(self):
2875 if ( 2876 self.valueOf_ 2877 ): 2878 return True 2879 else: 2880 return False
2881 - def exportLiteral(self, outfile, level, name_='TimePeriodType'):
2882 level += 1 2883 self.exportLiteralAttributes(outfile, level, [], name_) 2884 if self.hasContent_(): 2885 self.exportLiteralChildren(outfile, level, name_) 2886 showIndent(outfile, level) 2887 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
2888 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2889 pass
2890 - def exportLiteralChildren(self, outfile, level, name_):
2891 pass
2892 - def build(self, node):
2893 self.buildAttributes(node, node.attrib, []) 2894 self.valueOf_ = get_all_text_(node) 2895 for child in node: 2896 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2897 self.buildChildren(child, nodeName_)
2898 - def buildAttributes(self, node, attrs, already_processed):
2899 pass
2900 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2901 pass
2902 # end class TimePeriodType 2903 2904
2905 -class TimeIntervalType(TimePeriodType):
2906 """For where a series has multiple observations, and a define 2907 beingDateTime as dateTime of the first data value in the series, 2908 and endDateTime dateTime of the last data value in the series.""" 2909 subclass = None 2910 superclass = TimePeriodType
2911 - def __init__(self, beginDateTime=None, endDateTime=None):
2912 super(TimeIntervalType, self).__init__() 2913 self.beginDateTime = beginDateTime 2914 self.endDateTime = endDateTime
2915 - def factory(*args_, **kwargs_):
2916 if TimeIntervalType.subclass: 2917 return TimeIntervalType.subclass(*args_, **kwargs_) 2918 else: 2919 return TimeIntervalType(*args_, **kwargs_)
2920 factory = staticmethod(factory)
2921 - def get_beginDateTime(self): return self.beginDateTime
2922 - def set_beginDateTime(self, beginDateTime): self.beginDateTime = beginDateTime
2923 - def get_endDateTime(self): return self.endDateTime
2924 - def set_endDateTime(self, endDateTime): self.endDateTime = endDateTime
2925 - def export(self, outfile, level, namespace_='', name_='TimeIntervalType', namespacedef_=''):
2926 showIndent(outfile, level) 2927 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2928 self.exportAttributes(outfile, level, [], namespace_, name_='TimeIntervalType') 2929 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 2930 outfile.write(' xsi:type="TimeIntervalType"') 2931 if self.hasContent_(): 2932 outfile.write('>\n') 2933 self.exportChildren(outfile, level + 1, namespace_, name_) 2934 showIndent(outfile, level) 2935 outfile.write('</%s%s>\n' % (namespace_, name_)) 2936 else: 2937 outfile.write('/>\n')
2938 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeIntervalType'):
2939 super(TimeIntervalType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TimeIntervalType')
2940 - def exportChildren(self, outfile, level, namespace_='', name_='TimeIntervalType'):
2941 super(TimeIntervalType, self).exportChildren(outfile, level, namespace_, name_) 2942 if self.beginDateTime is not None: 2943 showIndent(outfile, level) 2944 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_)) 2945 if self.endDateTime is not None: 2946 showIndent(outfile, level) 2947 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
2948 - def hasContent_(self):
2949 if ( 2950 self.beginDateTime is not None or 2951 self.endDateTime is not None or 2952 super(TimeIntervalType, self).hasContent_() 2953 ): 2954 return True 2955 else: 2956 return False
2957 - def exportLiteral(self, outfile, level, name_='TimeIntervalType'):
2958 level += 1 2959 self.exportLiteralAttributes(outfile, level, [], name_) 2960 if self.hasContent_(): 2961 self.exportLiteralChildren(outfile, level, name_)
2962 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2963 super(TimeIntervalType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
2964 - def exportLiteralChildren(self, outfile, level, name_):
2965 super(TimeIntervalType, self).exportLiteralChildren(outfile, level, name_) 2966 if self.beginDateTime is not None: 2967 showIndent(outfile, level) 2968 outfile.write('beginDateTime=%s,\n' % quote_python(self.beginDateTime).encode(ExternalEncoding)) 2969 if self.endDateTime is not None: 2970 showIndent(outfile, level) 2971 outfile.write('endDateTime=%s,\n' % quote_python(self.endDateTime).encode(ExternalEncoding))
2972 - def build(self, node):
2973 self.buildAttributes(node, node.attrib, []) 2974 for child in node: 2975 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2976 self.buildChildren(child, nodeName_)
2977 - def buildAttributes(self, node, attrs, already_processed):
2978 super(TimeIntervalType, self).buildAttributes(node, attrs, already_processed)
2979 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2980 if nodeName_ == 'beginDateTime': 2981 beginDateTime_ = child_.text 2982 self.beginDateTime = beginDateTime_ 2983 elif nodeName_ == 'endDateTime': 2984 endDateTime_ = child_.text 2985 self.endDateTime = endDateTime_ 2986 super(TimeIntervalType, self).buildChildren(child_, nodeName_, True)
2987 # end class TimeIntervalType 2988 2989
2990 -class TimeSingleType(TimePeriodType):
2991 """For where a series is a single observation. timeSingle, 2992 beginDateTime, and endDateTime will have the same value. The 2993 beginDateTime and endDateTime are provided to simplify usage by 2994 clients.They should be be calculated based on the duration 2995 stored in realTimeDataPeriod""" 2996 subclass = None 2997 superclass = TimePeriodType
2998 - def __init__(self, timeSingle=None, beginDateTime=None, endDateTime=None):
2999 super(TimeSingleType, self).__init__() 3000 self.timeSingle = timeSingle 3001 self.beginDateTime = beginDateTime 3002 self.endDateTime = endDateTime
3003 - def factory(*args_, **kwargs_):
3004 if TimeSingleType.subclass: 3005 return TimeSingleType.subclass(*args_, **kwargs_) 3006 else: 3007 return TimeSingleType(*args_, **kwargs_)
3008 factory = staticmethod(factory)
3009 - def get_timeSingle(self): return self.timeSingle
3010 - def set_timeSingle(self, timeSingle): self.timeSingle = timeSingle
3011 - def get_beginDateTime(self): return self.beginDateTime
3012 - def set_beginDateTime(self, beginDateTime): self.beginDateTime = beginDateTime
3013 - def get_endDateTime(self): return self.endDateTime
3014 - def set_endDateTime(self, endDateTime): self.endDateTime = endDateTime
3015 - def export(self, outfile, level, namespace_='', name_='TimeSingleType', namespacedef_=''):
3016 showIndent(outfile, level) 3017 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3018 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSingleType') 3019 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 3020 outfile.write(' xsi:type="TimeSingleType"') 3021 if self.hasContent_(): 3022 outfile.write('>\n') 3023 self.exportChildren(outfile, level + 1, namespace_, name_) 3024 showIndent(outfile, level) 3025 outfile.write('</%s%s>\n' % (namespace_, name_)) 3026 else: 3027 outfile.write('/>\n')
3028 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSingleType'):
3029 super(TimeSingleType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TimeSingleType')
3030 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSingleType'):
3031 super(TimeSingleType, self).exportChildren(outfile, level, namespace_, name_) 3032 if self.timeSingle is not None: 3033 showIndent(outfile, level) 3034 outfile.write('<%stimeSingle>%s</%stimeSingle>\n' % (namespace_, self.gds_format_string(quote_xml(self.timeSingle).encode(ExternalEncoding), input_name='timeSingle'), namespace_)) 3035 if self.beginDateTime is not None: 3036 showIndent(outfile, level) 3037 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_)) 3038 if self.endDateTime is not None: 3039 showIndent(outfile, level) 3040 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
3041 - def hasContent_(self):
3042 if ( 3043 self.timeSingle is not None or 3044 self.beginDateTime is not None or 3045 self.endDateTime is not None or 3046 super(TimeSingleType, self).hasContent_() 3047 ): 3048 return True 3049 else: 3050 return False
3051 - def exportLiteral(self, outfile, level, name_='TimeSingleType'):
3052 level += 1 3053 self.exportLiteralAttributes(outfile, level, [], name_) 3054 if self.hasContent_(): 3055 self.exportLiteralChildren(outfile, level, name_)
3056 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3057 super(TimeSingleType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
3058 - def exportLiteralChildren(self, outfile, level, name_):
3059 super(TimeSingleType, self).exportLiteralChildren(outfile, level, name_) 3060 if self.timeSingle is not None: 3061 showIndent(outfile, level) 3062 outfile.write('timeSingle=%s,\n' % quote_python(self.timeSingle).encode(ExternalEncoding)) 3063 if self.beginDateTime is not None: 3064 showIndent(outfile, level) 3065 outfile.write('beginDateTime=%s,\n' % quote_python(self.beginDateTime).encode(ExternalEncoding)) 3066 if self.endDateTime is not None: 3067 showIndent(outfile, level) 3068 outfile.write('endDateTime=%s,\n' % quote_python(self.endDateTime).encode(ExternalEncoding))
3069 - def build(self, node):
3070 self.buildAttributes(node, node.attrib, []) 3071 for child in node: 3072 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3073 self.buildChildren(child, nodeName_)
3074 - def buildAttributes(self, node, attrs, already_processed):
3075 super(TimeSingleType, self).buildAttributes(node, attrs, already_processed)
3076 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3077 if nodeName_ == 'timeSingle': 3078 timeSingle_ = child_.text 3079 self.timeSingle = timeSingle_ 3080 elif nodeName_ == 'beginDateTime': 3081 beginDateTime_ = child_.text 3082 self.beginDateTime = beginDateTime_ 3083 elif nodeName_ == 'endDateTime': 3084 endDateTime_ = child_.text 3085 self.endDateTime = endDateTime_ 3086 super(TimeSingleType, self).buildChildren(child_, nodeName_, True)
3087 # end class TimeSingleType 3088 3089
3090 -class TimePeriodRealTimeType(TimePeriodType):
3091 """Use where a site has an evolving period where data is available. The 3092 US Geological Survey real time data is available for 30 days, 3093 the realTimeDataPeriod element is an XML duration and woudl be 3094 "30d" The beginDateTime and endDateTime are provided to simplify 3095 usage by clients.They should be be calculated based on the 3096 duration stored in realTimeDataPeriod""" 3097 subclass = None 3098 superclass = TimePeriodType
3099 - def __init__(self, realTimeDataPeriod=None, beginDateTime=None, endDateTime=None):
3100 super(TimePeriodRealTimeType, self).__init__() 3101 self.realTimeDataPeriod = realTimeDataPeriod 3102 self.beginDateTime = beginDateTime 3103 self.endDateTime = endDateTime
3104 - def factory(*args_, **kwargs_):
3105 if TimePeriodRealTimeType.subclass: 3106 return TimePeriodRealTimeType.subclass(*args_, **kwargs_) 3107 else: 3108 return TimePeriodRealTimeType(*args_, **kwargs_)
3109 factory = staticmethod(factory)
3110 - def get_realTimeDataPeriod(self): return self.realTimeDataPeriod
3111 - def set_realTimeDataPeriod(self, realTimeDataPeriod): self.realTimeDataPeriod = realTimeDataPeriod
3112 - def get_beginDateTime(self): return self.beginDateTime
3113 - def set_beginDateTime(self, beginDateTime): self.beginDateTime = beginDateTime
3114 - def get_endDateTime(self): return self.endDateTime
3115 - def set_endDateTime(self, endDateTime): self.endDateTime = endDateTime
3116 - def export(self, outfile, level, namespace_='', name_='TimePeriodRealTimeType', namespacedef_=''):
3117 showIndent(outfile, level) 3118 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3119 self.exportAttributes(outfile, level, [], namespace_, name_='TimePeriodRealTimeType') 3120 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 3121 outfile.write(' xsi:type="TimePeriodRealTimeType"') 3122 if self.hasContent_(): 3123 outfile.write('>\n') 3124 self.exportChildren(outfile, level + 1, namespace_, name_) 3125 showIndent(outfile, level) 3126 outfile.write('</%s%s>\n' % (namespace_, name_)) 3127 else: 3128 outfile.write('/>\n')
3129 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimePeriodRealTimeType'):
3130 super(TimePeriodRealTimeType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TimePeriodRealTimeType')
3131 - def exportChildren(self, outfile, level, namespace_='', name_='TimePeriodRealTimeType'):
3132 super(TimePeriodRealTimeType, self).exportChildren(outfile, level, namespace_, name_) 3133 if self.realTimeDataPeriod is not None: 3134 showIndent(outfile, level) 3135 outfile.write('<%srealTimeDataPeriod>%s</%srealTimeDataPeriod>\n' % (namespace_, self.gds_format_string(quote_xml(self.realTimeDataPeriod).encode(ExternalEncoding), input_name='realTimeDataPeriod'), namespace_)) 3136 if self.beginDateTime is not None: 3137 showIndent(outfile, level) 3138 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_)) 3139 if self.endDateTime is not None: 3140 showIndent(outfile, level) 3141 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
3142 - def hasContent_(self):
3143 if ( 3144 self.realTimeDataPeriod is not None or 3145 self.beginDateTime is not None or 3146 self.endDateTime is not None or 3147 super(TimePeriodRealTimeType, self).hasContent_() 3148 ): 3149 return True 3150 else: 3151 return False
3152 - def exportLiteral(self, outfile, level, name_='TimePeriodRealTimeType'):
3153 level += 1 3154 self.exportLiteralAttributes(outfile, level, [], name_) 3155 if self.hasContent_(): 3156 self.exportLiteralChildren(outfile, level, name_)
3157 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3158 super(TimePeriodRealTimeType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
3159 - def exportLiteralChildren(self, outfile, level, name_):
3160 super(TimePeriodRealTimeType, self).exportLiteralChildren(outfile, level, name_) 3161 if self.realTimeDataPeriod is not None: 3162 showIndent(outfile, level) 3163 outfile.write('realTimeDataPeriod=%s,\n' % quote_python(self.realTimeDataPeriod).encode(ExternalEncoding)) 3164 if self.beginDateTime is not None: 3165 showIndent(outfile, level) 3166 outfile.write('beginDateTime=%s,\n' % quote_python(self.beginDateTime).encode(ExternalEncoding)) 3167 if self.endDateTime is not None: 3168 showIndent(outfile, level) 3169 outfile.write('endDateTime=%s,\n' % quote_python(self.endDateTime).encode(ExternalEncoding))
3170 - def build(self, node):
3171 self.buildAttributes(node, node.attrib, []) 3172 for child in node: 3173 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3174 self.buildChildren(child, nodeName_)
3175 - def buildAttributes(self, node, attrs, already_processed):
3176 super(TimePeriodRealTimeType, self).buildAttributes(node, attrs, already_processed)
3177 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3178 if nodeName_ == 'realTimeDataPeriod': 3179 realTimeDataPeriod_ = child_.text 3180 self.realTimeDataPeriod = realTimeDataPeriod_ 3181 elif nodeName_ == 'beginDateTime': 3182 beginDateTime_ = child_.text 3183 self.beginDateTime = beginDateTime_ 3184 elif nodeName_ == 'endDateTime': 3185 endDateTime_ = child_.text 3186 self.endDateTime = endDateTime_ 3187 super(TimePeriodRealTimeType, self).buildChildren(child_, nodeName_, True)
3188 # end class TimePeriodRealTimeType 3189 3190
3191 -class GeogLocationType(GeneratedsSuper):
3192 """GeogLocationType is the base class for the two geometry types: 3193 LatLonPointType, and LatLonBoxType. Any additional types should 3194 derive from this type. The default spatial reference system is 3195 @srs is EPSG:4326 or Geographic lat long.""" 3196 subclass = None 3197 superclass = None
3198 - def __init__(self, srs='EPSG:4326', valueOf_=None):
3199 self.srs = _cast(None, srs) 3200 self.valueOf_ = valueOf_
3201 - def factory(*args_, **kwargs_):
3202 if GeogLocationType.subclass: 3203 return GeogLocationType.subclass(*args_, **kwargs_) 3204 else: 3205 return GeogLocationType(*args_, **kwargs_)
3206 factory = staticmethod(factory)
3207 - def get_srs(self): return self.srs
3208 - def set_srs(self, srs): self.srs = srs
3209 - def get_valueOf_(self): return self.valueOf_
3210 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
3211 - def export(self, outfile, level, namespace_='', name_='GeogLocationType', namespacedef_=''):
3212 showIndent(outfile, level) 3213 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3214 self.exportAttributes(outfile, level, [], namespace_, name_='GeogLocationType') 3215 if self.hasContent_(): 3216 outfile.write('>') 3217 outfile.write(self.valueOf_) 3218 self.exportChildren(outfile, level + 1, namespace_, name_) 3219 outfile.write('</%s%s>\n' % (namespace_, name_)) 3220 else: 3221 outfile.write('/>\n')
3222 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='GeogLocationType'):
3223 if self.srs is not None and 'srs' not in already_processed: 3224 already_processed.append('srs') 3225 outfile.write(' srs=%s' % (self.gds_format_string(quote_attrib(self.srs).encode(ExternalEncoding), input_name='srs'), ))
3226 - def exportChildren(self, outfile, level, namespace_='', name_='GeogLocationType'):
3227 pass
3228 - def hasContent_(self):
3229 if ( 3230 self.valueOf_ 3231 ): 3232 return True 3233 else: 3234 return False
3235 - def exportLiteral(self, outfile, level, name_='GeogLocationType'):
3236 level += 1 3237 self.exportLiteralAttributes(outfile, level, [], name_) 3238 if self.hasContent_(): 3239 self.exportLiteralChildren(outfile, level, name_) 3240 showIndent(outfile, level) 3241 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
3242 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3243 if self.srs is not None and 'srs' not in already_processed: 3244 already_processed.append('srs') 3245 showIndent(outfile, level) 3246 outfile.write('srs = "%s",\n' % (self.srs,))
3247 - def exportLiteralChildren(self, outfile, level, name_):
3248 pass
3249 - def build(self, node):
3250 self.buildAttributes(node, node.attrib, []) 3251 self.valueOf_ = get_all_text_(node) 3252 for child in node: 3253 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3254 self.buildChildren(child, nodeName_)
3255 - def buildAttributes(self, node, attrs, already_processed):
3256 value = attrs.get('srs') 3257 if value is not None and 'srs' not in already_processed: 3258 already_processed.append('srs') 3259 self.srs = value
3260 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3261 pass
3262 # end class GeogLocationType 3263 3264
3265 -class LatLonPointType(GeogLocationType):
3266 subclass = None 3267 superclass = GeogLocationType
3268 - def __init__(self, srs='EPSG:4326', latitude=None, longitude=None):
3269 super(LatLonPointType, self).__init__(srs, ) 3270 self.latitude = latitude 3271 self.longitude = longitude
3272 - def factory(*args_, **kwargs_):
3273 if LatLonPointType.subclass: 3274 return LatLonPointType.subclass(*args_, **kwargs_) 3275 else: 3276 return LatLonPointType(*args_, **kwargs_)
3277 factory = staticmethod(factory)
3278 - def get_latitude(self): return self.latitude
3279 - def set_latitude(self, latitude): self.latitude = latitude
3280 - def validate_latitude(self, value):
3281 # validate type latitude 3282 pass
3283 - def get_longitude(self): return self.longitude
3284 - def set_longitude(self, longitude): self.longitude = longitude
3285 - def validate_longitude(self, value):
3286 # validate type longitude 3287 pass
3288 - def export(self, outfile, level, namespace_='', name_='LatLonPointType', namespacedef_=''):
3289 showIndent(outfile, level) 3290 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3291 self.exportAttributes(outfile, level, [], namespace_, name_='LatLonPointType') 3292 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 3293 outfile.write(' xsi:type="LatLonPointType"') 3294 if self.hasContent_(): 3295 outfile.write('>\n') 3296 self.exportChildren(outfile, level + 1, namespace_, name_) 3297 showIndent(outfile, level) 3298 outfile.write('</%s%s>\n' % (namespace_, name_)) 3299 else: 3300 outfile.write('/>\n')
3301 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LatLonPointType'):
3302 super(LatLonPointType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='LatLonPointType')
3303 - def exportChildren(self, outfile, level, namespace_='', name_='LatLonPointType'):
3304 super(LatLonPointType, self).exportChildren(outfile, level, namespace_, name_) 3305 if self.latitude is not None: 3306 showIndent(outfile, level) 3307 outfile.write('<%slatitude>%s</%slatitude>\n' % (namespace_, self.gds_format_double(self.latitude, input_name='latitude'), namespace_)) 3308 if self.longitude is not None: 3309 showIndent(outfile, level) 3310 outfile.write('<%slongitude>%s</%slongitude>\n' % (namespace_, self.gds_format_double(self.longitude, input_name='longitude'), namespace_))
3311 - def hasContent_(self):
3312 if ( 3313 self.latitude is not None or 3314 self.longitude is not None or 3315 super(LatLonPointType, self).hasContent_() 3316 ): 3317 return True 3318 else: 3319 return False
3320 - def exportLiteral(self, outfile, level, name_='LatLonPointType'):
3321 level += 1 3322 self.exportLiteralAttributes(outfile, level, [], name_) 3323 if self.hasContent_(): 3324 self.exportLiteralChildren(outfile, level, name_)
3325 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3326 super(LatLonPointType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
3327 - def exportLiteralChildren(self, outfile, level, name_):
3328 super(LatLonPointType, self).exportLiteralChildren(outfile, level, name_) 3329 if self.latitude is not None: 3330 showIndent(outfile, level) 3331 outfile.write('latitude=%e,\n' % self.latitude) 3332 if self.longitude is not None: 3333 showIndent(outfile, level) 3334 outfile.write('longitude=%e,\n' % self.longitude)
3335 - def build(self, node):
3336 self.buildAttributes(node, node.attrib, []) 3337 for child in node: 3338 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3339 self.buildChildren(child, nodeName_)
3340 - def buildAttributes(self, node, attrs, already_processed):
3341 super(LatLonPointType, self).buildAttributes(node, attrs, already_processed)
3342 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3343 if nodeName_ == 'latitude': 3344 sval_ = child_.text 3345 try: 3346 fval_ = float(sval_) 3347 except (TypeError, ValueError), exp: 3348 raise_parse_error(child_, 'requires float or double: %s' % exp) 3349 self.latitude = fval_ 3350 self.validate_latitude(self.latitude) # validate type latitude 3351 elif nodeName_ == 'longitude': 3352 sval_ = child_.text 3353 try: 3354 fval_ = float(sval_) 3355 except (TypeError, ValueError), exp: 3356 raise_parse_error(child_, 'requires float or double: %s' % exp) 3357 self.longitude = fval_ 3358 self.validate_longitude(self.longitude) # validate type longitude 3359 super(LatLonPointType, self).buildChildren(child_, nodeName_, True)
3360 # end class LatLonPointType 3361 3362
3363 -class LatLonBoxType(GeogLocationType):
3364 subclass = None 3365 superclass = GeogLocationType
3366 - def __init__(self, srs='EPSG:4326', south=None, west=None, north=None, east=None):
3367 super(LatLonBoxType, self).__init__(srs, ) 3368 self.south = south 3369 self.west = west 3370 self.north = north 3371 self.east = east
3372 - def factory(*args_, **kwargs_):
3373 if LatLonBoxType.subclass: 3374 return LatLonBoxType.subclass(*args_, **kwargs_) 3375 else: 3376 return LatLonBoxType(*args_, **kwargs_)
3377 factory = staticmethod(factory)
3378 - def get_south(self): return self.south
3379 - def set_south(self, south): self.south = south
3380 - def validate_south(self, value):
3381 # validate type south 3382 pass
3383 - def get_west(self): return self.west
3384 - def set_west(self, west): self.west = west
3385 - def validate_west(self, value):
3386 # validate type west 3387 pass
3388 - def get_north(self): return self.north
3389 - def set_north(self, north): self.north = north
3390 - def validate_north(self, value):
3391 # validate type north 3392 pass
3393 - def get_east(self): return self.east
3394 - def set_east(self, east): self.east = east
3395 - def validate_east(self, value):
3396 # validate type east 3397 pass
3398 - def export(self, outfile, level, namespace_='', name_='LatLonBoxType', namespacedef_=''):
3399 showIndent(outfile, level) 3400 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3401 self.exportAttributes(outfile, level, [], namespace_, name_='LatLonBoxType') 3402 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 3403 outfile.write(' xsi:type="LatLonBoxType"') 3404 if self.hasContent_(): 3405 outfile.write('>\n') 3406 self.exportChildren(outfile, level + 1, namespace_, name_) 3407 showIndent(outfile, level) 3408 outfile.write('</%s%s>\n' % (namespace_, name_)) 3409 else: 3410 outfile.write('/>\n')
3411 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LatLonBoxType'):
3412 super(LatLonBoxType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='LatLonBoxType')
3413 - def exportChildren(self, outfile, level, namespace_='', name_='LatLonBoxType'):
3414 super(LatLonBoxType, self).exportChildren(outfile, level, namespace_, name_) 3415 if self.south is not None: 3416 showIndent(outfile, level) 3417 outfile.write('<%ssouth>%s</%ssouth>\n' % (namespace_, self.gds_format_double(self.south, input_name='south'), namespace_)) 3418 if self.west is not None: 3419 showIndent(outfile, level) 3420 outfile.write('<%swest>%s</%swest>\n' % (namespace_, self.gds_format_double(self.west, input_name='west'), namespace_)) 3421 if self.north is not None: 3422 showIndent(outfile, level) 3423 outfile.write('<%snorth>%s</%snorth>\n' % (namespace_, self.gds_format_double(self.north, input_name='north'), namespace_)) 3424 if self.east is not None: 3425 showIndent(outfile, level) 3426 outfile.write('<%seast>%s</%seast>\n' % (namespace_, self.gds_format_double(self.east, input_name='east'), namespace_))
3427 - def hasContent_(self):
3428 if ( 3429 self.south is not None or 3430 self.west is not None or 3431 self.north is not None or 3432 self.east is not None or 3433 super(LatLonBoxType, self).hasContent_() 3434 ): 3435 return True 3436 else: 3437 return False
3438 - def exportLiteral(self, outfile, level, name_='LatLonBoxType'):
3439 level += 1 3440 self.exportLiteralAttributes(outfile, level, [], name_) 3441 if self.hasContent_(): 3442 self.exportLiteralChildren(outfile, level, name_)
3443 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3444 super(LatLonBoxType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
3445 - def exportLiteralChildren(self, outfile, level, name_):
3446 super(LatLonBoxType, self).exportLiteralChildren(outfile, level, name_) 3447 if self.south is not None: 3448 showIndent(outfile, level) 3449 outfile.write('south=%e,\n' % self.south) 3450 if self.west is not None: 3451 showIndent(outfile, level) 3452 outfile.write('west=%e,\n' % self.west) 3453 if self.north is not None: 3454 showIndent(outfile, level) 3455 outfile.write('north=%e,\n' % self.north) 3456 if self.east is not None: 3457 showIndent(outfile, level) 3458 outfile.write('east=%e,\n' % self.east)
3459 - def build(self, node):
3460 self.buildAttributes(node, node.attrib, []) 3461 for child in node: 3462 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3463 self.buildChildren(child, nodeName_)
3464 - def buildAttributes(self, node, attrs, already_processed):
3465 super(LatLonBoxType, self).buildAttributes(node, attrs, already_processed)
3466 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3467 if nodeName_ == 'south': 3468 sval_ = child_.text 3469 try: 3470 fval_ = float(sval_) 3471 except (TypeError, ValueError), exp: 3472 raise_parse_error(child_, 'requires float or double: %s' % exp) 3473 self.south = fval_ 3474 self.validate_south(self.south) # validate type south 3475 elif nodeName_ == 'west': 3476 sval_ = child_.text 3477 try: 3478 fval_ = float(sval_) 3479 except (TypeError, ValueError), exp: 3480 raise_parse_error(child_, 'requires float or double: %s' % exp) 3481 self.west = fval_ 3482 self.validate_west(self.west) # validate type west 3483 elif nodeName_ == 'north': 3484 sval_ = child_.text 3485 try: 3486 fval_ = float(sval_) 3487 except (TypeError, ValueError), exp: 3488 raise_parse_error(child_, 'requires float or double: %s' % exp) 3489 self.north = fval_ 3490 self.validate_north(self.north) # validate type north 3491 elif nodeName_ == 'east': 3492 sval_ = child_.text 3493 try: 3494 fval_ = float(sval_) 3495 except (TypeError, ValueError), exp: 3496 raise_parse_error(child_, 'requires float or double: %s' % exp) 3497 self.east = fval_ 3498 self.validate_east(self.east) # validate type east 3499 super(LatLonBoxType, self).buildChildren(child_, nodeName_, True)
3500 # end class LatLonBoxType 3501 3502
3503 -class seriesCatalogType(GeneratedsSuper):
3504 """Series catalog represents a list of series, where each separate data 3505 series are for the purposes of identifying or displaying what 3506 data are available at each site. For clients, this is the list 3507 of the html select group element. This would allow for groups or 3508 seriesCatalogs to appear in an HTML select menu.(depreciated) 3509 location of the WaterOneFlow service that the client should 3510 execute GetValues call on. All services now proxy getValues 3511 methods from other sources.""" 3512 subclass = None 3513 superclass = None
3514 - def __init__(self, menuGroupName=None, serviceWsdl=None, note=None, series=None):
3515 self.menuGroupName = _cast(None, menuGroupName) 3516 self.serviceWsdl = _cast(None, serviceWsdl) 3517 if note is None: 3518 self.note = [] 3519 else: 3520 self.note = note 3521 if series is None: 3522 self.series = [] 3523 else: 3524 self.series = series
3525 - def factory(*args_, **kwargs_):
3526 if seriesCatalogType.subclass: 3527 return seriesCatalogType.subclass(*args_, **kwargs_) 3528 else: 3529 return seriesCatalogType(*args_, **kwargs_)
3530 factory = staticmethod(factory)
3531 - def get_note(self): return self.note
3532 - def set_note(self, note): self.note = note
3533 - def add_note(self, value): self.note.append(value)
3534 - def insert_note(self, index, value): self.note[index] = value
3535 - def get_series(self): return self.series
3536 - def set_series(self, series): self.series = series
3537 - def add_series(self, value): self.series.append(value)
3538 - def insert_series(self, index, value): self.series[index] = value
3539 - def get_menuGroupName(self): return self.menuGroupName
3540 - def set_menuGroupName(self, menuGroupName): self.menuGroupName = menuGroupName
3541 - def get_serviceWsdl(self): return self.serviceWsdl
3542 - def set_serviceWsdl(self, serviceWsdl): self.serviceWsdl = serviceWsdl
3543 - def export(self, outfile, level, namespace_='', name_='seriesCatalogType', namespacedef_=''):
3544 showIndent(outfile, level) 3545 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3546 self.exportAttributes(outfile, level, [], namespace_, name_='seriesCatalogType') 3547 if self.hasContent_(): 3548 outfile.write('>\n') 3549 self.exportChildren(outfile, level + 1, namespace_, name_) 3550 showIndent(outfile, level) 3551 outfile.write('</%s%s>\n' % (namespace_, name_)) 3552 else: 3553 outfile.write('/>\n')
3554 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='seriesCatalogType'):
3555 if self.menuGroupName is not None and 'menuGroupName' not in already_processed: 3556 already_processed.append('menuGroupName') 3557 outfile.write(' menuGroupName=%s' % (self.gds_format_string(quote_attrib(self.menuGroupName).encode(ExternalEncoding), input_name='menuGroupName'), )) 3558 if self.serviceWsdl is not None and 'serviceWsdl' not in already_processed: 3559 already_processed.append('serviceWsdl') 3560 outfile.write(' serviceWsdl=%s' % (self.gds_format_string(quote_attrib(self.serviceWsdl).encode(ExternalEncoding), input_name='serviceWsdl'), ))
3561 - def exportChildren(self, outfile, level, namespace_='', name_='seriesCatalogType'):
3562 for note_ in self.note: 3563 note_.export(outfile, level, namespace_, name_='note') 3564 for series_ in self.series: 3565 series_.export(outfile, level, namespace_, name_='series')
3566 - def hasContent_(self):
3567 if ( 3568 self.note or 3569 self.series 3570 ): 3571 return True 3572 else: 3573 return False
3574 - def exportLiteral(self, outfile, level, name_='seriesCatalogType'):
3575 level += 1 3576 self.exportLiteralAttributes(outfile, level, [], name_) 3577 if self.hasContent_(): 3578 self.exportLiteralChildren(outfile, level, name_)
3579 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3580 if self.menuGroupName is not None and 'menuGroupName' not in already_processed: 3581 already_processed.append('menuGroupName') 3582 showIndent(outfile, level) 3583 outfile.write('menuGroupName = "%s",\n' % (self.menuGroupName,)) 3584 if self.serviceWsdl is not None and 'serviceWsdl' not in already_processed: 3585 already_processed.append('serviceWsdl') 3586 showIndent(outfile, level) 3587 outfile.write('serviceWsdl = "%s",\n' % (self.serviceWsdl,))
3588 - def exportLiteralChildren(self, outfile, level, name_):
3589 showIndent(outfile, level) 3590 outfile.write('note=[\n') 3591 level += 1 3592 for note_ in self.note: 3593 showIndent(outfile, level) 3594 outfile.write('model_.NoteType(\n') 3595 note_.exportLiteral(outfile, level, name_='NoteType') 3596 showIndent(outfile, level) 3597 outfile.write('),\n') 3598 level -= 1 3599 showIndent(outfile, level) 3600 outfile.write('],\n') 3601 showIndent(outfile, level) 3602 outfile.write('series=[\n') 3603 level += 1 3604 for series_ in self.series: 3605 showIndent(outfile, level) 3606 outfile.write('model_.series(\n') 3607 series_.exportLiteral(outfile, level) 3608 showIndent(outfile, level) 3609 outfile.write('),\n') 3610 level -= 1 3611 showIndent(outfile, level) 3612 outfile.write('],\n')
3613 - def build(self, node):
3614 self.buildAttributes(node, node.attrib, []) 3615 for child in node: 3616 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3617 self.buildChildren(child, nodeName_)
3618 - def buildAttributes(self, node, attrs, already_processed):
3619 value = attrs.get('menuGroupName') 3620 if value is not None and 'menuGroupName' not in already_processed: 3621 already_processed.append('menuGroupName') 3622 self.menuGroupName = value 3623 value = attrs.get('serviceWsdl') 3624 if value is not None and 'serviceWsdl' not in already_processed: 3625 already_processed.append('serviceWsdl') 3626 self.serviceWsdl = value
3627 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3628 if nodeName_ == 'note': 3629 obj_ = NoteType.factory() 3630 obj_.build(child_) 3631 self.note.append(obj_) 3632 elif nodeName_ == 'series': 3633 obj_ = series.factory() 3634 obj_.build(child_) 3635 self.series.append(obj_)
3636 # end class seriesCatalogType 3637 3638
3639 -class series(GeneratedsSuper):
3640 """Separate data series are for the purposes of identifying or 3641 displaying what data are available at each site. Site 3642 information is a parent of the series so that it does not need 3643 to be repeated (difference from the ODM. ). A Site contains one 3644 or more seriesCatalogs which contain one or more series. 3645 Assotiated with site, a series is a unique combination of the 3646 textual repesentation of ODM series: 3647 Variable,Method,Source,QualityControlLevel. An ODM series is a 3648 unique site/variable combinations are defined by unique 3649 combinations of SiteID, VariableID, MethodID, SourceID, and 3650 QualityControlLevelID.""" 3651 subclass = None 3652 superclass = None
3653 - def __init__(self, dataType=None, variable=None, valueCount=None, variableTimeInterval=None, valueType=None, generalCategory=None, sampleMedium=None, Method=None, Source=None, QualityControlLevel=None):
3654 self.dataType = dataType 3655 self.variable = variable 3656 self.valueCount = valueCount 3657 self.variableTimeInterval = variableTimeInterval 3658 self.valueType = valueType 3659 self.generalCategory = generalCategory 3660 self.sampleMedium = sampleMedium 3661 self.Method = Method 3662 self.Source = Source 3663 self.QualityControlLevel = QualityControlLevel
3664 - def factory(*args_, **kwargs_):
3665 if series.subclass: 3666 return series.subclass(*args_, **kwargs_) 3667 else: 3668 return series(*args_, **kwargs_)
3669 factory = staticmethod(factory)
3670 - def get_dataType(self): return self.dataType
3671 - def set_dataType(self, dataType): self.dataType = dataType
3672 - def validate_dataType(self, value):
3673 # validate type dataType 3674 pass
3675 - def get_variable(self): return self.variable
3676 - def set_variable(self, variable): self.variable = variable
3677 - def get_valueCount(self): return self.valueCount
3678 - def set_valueCount(self, valueCount): self.valueCount = valueCount
3679 - def get_variableTimeInterval(self): return self.variableTimeInterval
3680 - def set_variableTimeInterval(self, variableTimeInterval): self.variableTimeInterval = variableTimeInterval
3681 - def get_valueType(self): return self.valueType
3682 - def set_valueType(self, valueType): self.valueType = valueType
3683 - def validate_valueType(self, value):
3684 # validate type valueType 3685 pass
3686 - def get_generalCategory(self): return self.generalCategory
3687 - def set_generalCategory(self, generalCategory): self.generalCategory = generalCategory
3688 - def validate_generalCategory(self, value):
3689 # validate type generalCategory 3690 pass
3691 - def get_sampleMedium(self): return self.sampleMedium
3692 - def set_sampleMedium(self, sampleMedium): self.sampleMedium = sampleMedium
3693 - def validate_sampleMedium(self, value):
3694 # validate type sampleMedium 3695 pass
3696 - def get_Method(self): return self.Method
3697 - def set_Method(self, Method): self.Method = Method
3698 - def get_Source(self): return self.Source
3699 - def set_Source(self, Source): self.Source = Source
3700 - def get_QualityControlLevel(self): return self.QualityControlLevel
3701 - def set_QualityControlLevel(self, QualityControlLevel): self.QualityControlLevel = QualityControlLevel
3702 - def export(self, outfile, level, namespace_='', name_='series', namespacedef_=''):
3703 showIndent(outfile, level) 3704 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3705 self.exportAttributes(outfile, level, [], namespace_, name_='series') 3706 if self.hasContent_(): 3707 outfile.write('>\n') 3708 self.exportChildren(outfile, level + 1, namespace_, name_) 3709 showIndent(outfile, level) 3710 outfile.write('</%s%s>\n' % (namespace_, name_)) 3711 else: 3712 outfile.write('/>\n')
3713 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='series'):
3714 pass
3715 - def exportChildren(self, outfile, level, namespace_='', name_='series'):
3716 if self.dataType is not None: 3717 showIndent(outfile, level) 3718 outfile.write('<%sdataType>%s</%sdataType>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataType).encode(ExternalEncoding), input_name='dataType'), namespace_)) 3719 if self.variable: 3720 self.variable.export(outfile, level, namespace_, name_='variable', ) 3721 if self.valueCount: 3722 self.valueCount.export(outfile, level, namespace_, name_='valueCount', ) 3723 if self.variableTimeInterval: 3724 self.variableTimeInterval.export(outfile, level, namespace_, name_='variableTimeInterval', ) 3725 if self.valueType is not None: 3726 showIndent(outfile, level) 3727 outfile.write('<%svalueType>%s</%svalueType>\n' % (namespace_, self.gds_format_string(quote_xml(self.valueType).encode(ExternalEncoding), input_name='valueType'), namespace_)) 3728 if self.generalCategory is not None: 3729 showIndent(outfile, level) 3730 outfile.write('<%sgeneralCategory>%s</%sgeneralCategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.generalCategory).encode(ExternalEncoding), input_name='generalCategory'), namespace_)) 3731 if self.sampleMedium is not None: 3732 showIndent(outfile, level) 3733 outfile.write('<%ssampleMedium>%s</%ssampleMedium>\n' % (namespace_, self.gds_format_string(quote_xml(self.sampleMedium).encode(ExternalEncoding), input_name='sampleMedium'), namespace_)) 3734 if self.Method: 3735 self.Method.export(outfile, level, namespace_, name_='Method') 3736 if self.Source: 3737 self.Source.export(outfile, level, namespace_, name_='Source') 3738 if self.QualityControlLevel: 3739 self.QualityControlLevel.export(outfile, level, namespace_, name_='QualityControlLevel')
3740 - def hasContent_(self):
3741 if ( 3742 self.dataType is not None or 3743 self.variable is not None or 3744 self.valueCount is not None or 3745 self.variableTimeInterval is not None or 3746 self.valueType is not None or 3747 self.generalCategory is not None or 3748 self.sampleMedium is not None or 3749 self.Method is not None or 3750 self.Source is not None or 3751 self.QualityControlLevel is not None 3752 ): 3753 return True 3754 else: 3755 return False
3756 - def exportLiteral(self, outfile, level, name_='series'):
3757 level += 1 3758 self.exportLiteralAttributes(outfile, level, [], name_) 3759 if self.hasContent_(): 3760 self.exportLiteralChildren(outfile, level, name_)
3761 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3762 pass
3763 - def exportLiteralChildren(self, outfile, level, name_):
3764 if self.dataType is not None: 3765 showIndent(outfile, level) 3766 outfile.write('dataType=%s,\n' % quote_python(self.dataType).encode(ExternalEncoding)) 3767 if self.variable is not None: 3768 showIndent(outfile, level) 3769 outfile.write('variable=model_.VariableInfoType(\n') 3770 self.variable.exportLiteral(outfile, level, name_='variable') 3771 showIndent(outfile, level) 3772 outfile.write('),\n') 3773 if self.valueCount is not None: 3774 showIndent(outfile, level) 3775 outfile.write('valueCount=model_.valueCount(\n') 3776 self.valueCount.exportLiteral(outfile, level) 3777 showIndent(outfile, level) 3778 outfile.write('),\n') 3779 if self.variableTimeInterval is not None: 3780 showIndent(outfile, level) 3781 outfile.write('variableTimeInterval=model_.TimePeriodType(\n') 3782 self.variableTimeInterval.exportLiteral(outfile, level, name_='variableTimeInterval') 3783 showIndent(outfile, level) 3784 outfile.write('),\n') 3785 if self.valueType is not None: 3786 showIndent(outfile, level) 3787 outfile.write('valueType=%s,\n' % quote_python(self.valueType).encode(ExternalEncoding)) 3788 if self.generalCategory is not None: 3789 showIndent(outfile, level) 3790 outfile.write('generalCategory=%s,\n' % quote_python(self.generalCategory).encode(ExternalEncoding)) 3791 if self.sampleMedium is not None: 3792 showIndent(outfile, level) 3793 outfile.write('sampleMedium=%s,\n' % quote_python(self.sampleMedium).encode(ExternalEncoding)) 3794 if self.Method is not None: 3795 showIndent(outfile, level) 3796 outfile.write('Method=model_.MethodType(\n') 3797 self.Method.exportLiteral(outfile, level, name_='Method') 3798 showIndent(outfile, level) 3799 outfile.write('),\n') 3800 if self.Source is not None: 3801 showIndent(outfile, level) 3802 outfile.write('Source=model_.SourceType(\n') 3803 self.Source.exportLiteral(outfile, level, name_='Source') 3804 showIndent(outfile, level) 3805 outfile.write('),\n') 3806 if self.QualityControlLevel is not None: 3807 showIndent(outfile, level) 3808 outfile.write('QualityControlLevel=model_.QualityControlLevelType(\n') 3809 self.QualityControlLevel.exportLiteral(outfile, level, name_='QualityControlLevel') 3810 showIndent(outfile, level) 3811 outfile.write('),\n')
3812 - def build(self, node):
3813 self.buildAttributes(node, node.attrib, []) 3814 for child in node: 3815 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3816 self.buildChildren(child, nodeName_)
3817 - def buildAttributes(self, node, attrs, already_processed):
3818 pass
3819 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3820 if nodeName_ == 'dataType': 3821 dataType_ = child_.text 3822 self.dataType = dataType_ 3823 self.validate_dataType(self.dataType) # validate type dataType 3824 elif nodeName_ == 'variable': 3825 obj_ = VariableInfoType.factory() 3826 obj_.build(child_) 3827 self.set_variable(obj_) 3828 elif nodeName_ == 'valueCount': 3829 obj_ = valueCount.factory() 3830 obj_.build(child_) 3831 self.set_valueCount(obj_) 3832 elif nodeName_ == 'variableTimeInterval': 3833 obj_ = TimePeriodType.factory() 3834 obj_.build(child_) 3835 self.set_variableTimeInterval(obj_) 3836 elif nodeName_ == 'valueType': 3837 valueType_ = child_.text 3838 self.valueType = valueType_ 3839 self.validate_valueType(self.valueType) # validate type valueType 3840 elif nodeName_ == 'generalCategory': 3841 generalCategory_ = child_.text 3842 self.generalCategory = generalCategory_ 3843 self.validate_generalCategory(self.generalCategory) # validate type generalCategory 3844 elif nodeName_ == 'sampleMedium': 3845 sampleMedium_ = child_.text 3846 self.sampleMedium = sampleMedium_ 3847 self.validate_sampleMedium(self.sampleMedium) # validate type sampleMedium 3848 elif nodeName_ == 'Method': 3849 obj_ = MethodType.factory() 3850 obj_.build(child_) 3851 self.set_Method(obj_) 3852 elif nodeName_ == 'Source': 3853 obj_ = SourceType.factory() 3854 obj_.build(child_) 3855 self.set_Source(obj_) 3856 elif nodeName_ == 'QualityControlLevel': 3857 obj_ = QualityControlLevelType.factory() 3858 obj_.build(child_) 3859 self.set_QualityControlLevel(obj_)
3860 # end class series 3861 3862
3863 -class valueCount(GeneratedsSuper):
3864 subclass = None 3865 superclass = None
3866 - def __init__(self, countIsEstimated=None, valueOf_=None):
3867 self.countIsEstimated = _cast(bool, countIsEstimated) 3868 self.valueOf_ = valueOf_
3869 - def factory(*args_, **kwargs_):
3870 if valueCount.subclass: 3871 return valueCount.subclass(*args_, **kwargs_) 3872 else: 3873 return valueCount(*args_, **kwargs_)
3874 factory = staticmethod(factory)
3875 - def get_countIsEstimated(self): return self.countIsEstimated
3876 - def set_countIsEstimated(self, countIsEstimated): self.countIsEstimated = countIsEstimated
3877 - def get_valueOf_(self): return self.valueOf_
3878 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
3879 - def export(self, outfile, level, namespace_='', name_='valueCount', namespacedef_=''):
3880 showIndent(outfile, level) 3881 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3882 self.exportAttributes(outfile, level, [], namespace_, name_='valueCount') 3883 if self.hasContent_(): 3884 outfile.write('>') 3885 outfile.write(self.valueOf_) 3886 self.exportChildren(outfile, level + 1, namespace_, name_) 3887 outfile.write('</%s%s>\n' % (namespace_, name_)) 3888 else: 3889 outfile.write('/>\n')
3890 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='valueCount'):
3891 if self.countIsEstimated is not None and 'countIsEstimated' not in already_processed: 3892 already_processed.append('countIsEstimated') 3893 outfile.write(' countIsEstimated="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.countIsEstimated)), input_name='countIsEstimated'))
3894 - def exportChildren(self, outfile, level, namespace_='', name_='valueCount'):
3895 pass
3896 - def hasContent_(self):
3897 if ( 3898 self.valueOf_ 3899 ): 3900 return True 3901 else: 3902 return False
3903 - def exportLiteral(self, outfile, level, name_='valueCount'):
3904 level += 1 3905 self.exportLiteralAttributes(outfile, level, [], name_) 3906 if self.hasContent_(): 3907 self.exportLiteralChildren(outfile, level, name_) 3908 showIndent(outfile, level) 3909 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
3910 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3911 if self.countIsEstimated is not None and 'countIsEstimated' not in already_processed: 3912 already_processed.append('countIsEstimated') 3913 showIndent(outfile, level) 3914 outfile.write('countIsEstimated = %s,\n' % (self.countIsEstimated,))
3915 - def exportLiteralChildren(self, outfile, level, name_):
3916 pass
3917 - def build(self, node):
3918 self.buildAttributes(node, node.attrib, []) 3919 self.valueOf_ = get_all_text_(node) 3920 for child in node: 3921 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3922 self.buildChildren(child, nodeName_)
3923 - def buildAttributes(self, node, attrs, already_processed):
3924 value = attrs.get('countIsEstimated') 3925 if value is not None and 'countIsEstimated' not in already_processed: 3926 already_processed.append('countIsEstimated') 3927 if value in ('true', '1'): 3928 self.countIsEstimated = True 3929 elif value in ('false', '0'): 3930 self.countIsEstimated = False 3931 else: 3932 raise_parse_error(node, 'Bad boolean attribute')
3933 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3934 pass
3935 # end class valueCount 3936 3937
3938 -class QualifiersType(GeneratedsSuper):
3939 """qualifying comments that accompany the data""" 3940 subclass = None 3941 superclass = None
3942 - def __init__(self, qualifier=None):
3943 self.qualifier = qualifier
3944 - def factory(*args_, **kwargs_):
3945 if QualifiersType.subclass: 3946 return QualifiersType.subclass(*args_, **kwargs_) 3947 else: 3948 return QualifiersType(*args_, **kwargs_)
3949 factory = staticmethod(factory)
3950 - def get_qualifier(self): return self.qualifier
3951 - def set_qualifier(self, qualifier): self.qualifier = qualifier
3952 - def export(self, outfile, level, namespace_='', name_='QualifiersType', namespacedef_=''):
3953 showIndent(outfile, level) 3954 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3955 self.exportAttributes(outfile, level, [], namespace_, name_='QualifiersType') 3956 if self.hasContent_(): 3957 outfile.write('>\n') 3958 self.exportChildren(outfile, level + 1, namespace_, name_) 3959 showIndent(outfile, level) 3960 outfile.write('</%s%s>\n' % (namespace_, name_)) 3961 else: 3962 outfile.write('/>\n')
3963 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QualifiersType'):
3964 pass
3965 - def exportChildren(self, outfile, level, namespace_='', name_='QualifiersType'):
3966 if self.qualifier: 3967 self.qualifier.export(outfile, level, namespace_, name_='qualifier', )
3968 - def hasContent_(self):
3969 if ( 3970 self.qualifier is not None 3971 ): 3972 return True 3973 else: 3974 return False
3975 - def exportLiteral(self, outfile, level, name_='QualifiersType'):
3976 level += 1 3977 self.exportLiteralAttributes(outfile, level, [], name_) 3978 if self.hasContent_(): 3979 self.exportLiteralChildren(outfile, level, name_)
3980 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3981 pass
3982 - def exportLiteralChildren(self, outfile, level, name_):
3983 if self.qualifier is not None: 3984 showIndent(outfile, level) 3985 outfile.write('qualifier=model_.qualifier(\n') 3986 self.qualifier.exportLiteral(outfile, level) 3987 showIndent(outfile, level) 3988 outfile.write('),\n')
3989 - def build(self, node):
3990 self.buildAttributes(node, node.attrib, []) 3991 for child in node: 3992 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3993 self.buildChildren(child, nodeName_)
3994 - def buildAttributes(self, node, attrs, already_processed):
3995 pass
3996 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3997 if nodeName_ == 'qualifier': 3998 obj_ = qualifier.factory() 3999 obj_.build(child_) 4000 self.set_qualifier(obj_)
4001 # end class QualifiersType 4002 4003
4004 -class qualifier(GeneratedsSuper):
4005 """qualifying comments that accompany the data. value/@qaulifier is a 4006 space delimted list of qualifiers for a data value. 4007 @qualifierCode is the link to the value/@qualifier for a single 4008 value The value inside provides the textual description. 4009 @qualifierCode is the reference code. @qualifierCode=A qualifier 4010 value=Approved @vocabulary and @network are suggested. For 4011 example a value from the USGS may qualifiers from multiple 4012 vocabularies, and the network would be the data service.""" 4013 subclass = None 4014 superclass = None
4015 - def __init__(self, qualifierID=None, default=None, network=None, vocabulary=None, qualifierCode=None):
4016 self.qualifierID = _cast(int, qualifierID) 4017 self.default = _cast(bool, default) 4018 self.network = _cast(None, network) 4019 self.vocabulary = _cast(None, vocabulary) 4020 self.qualifierCode = qualifierCode
4021 - def factory(*args_, **kwargs_):
4022 if qualifier.subclass: 4023 return qualifier.subclass(*args_, **kwargs_) 4024 else: 4025 return qualifier(*args_, **kwargs_)
4026 factory = staticmethod(factory)
4027 - def get_qualifierCode(self): return self.qualifierCode
4028 - def set_qualifierCode(self, qualifierCode): self.qualifierCode = qualifierCode
4029 - def get_qualifierID(self): return self.qualifierID
4030 - def set_qualifierID(self, qualifierID): self.qualifierID = qualifierID
4031 - def get_default(self): return self.default
4032 - def set_default(self, default): self.default = default
4033 - def get_network(self): return self.network
4034 - def set_network(self, network): self.network = network
4035 - def get_vocabulary(self): return self.vocabulary
4036 - def set_vocabulary(self, vocabulary): self.vocabulary = vocabulary
4037 - def export(self, outfile, level, namespace_='', name_='qualifier', namespacedef_=''):
4038 showIndent(outfile, level) 4039 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4040 self.exportAttributes(outfile, level, [], namespace_, name_='qualifier') 4041 if self.hasContent_(): 4042 outfile.write('>\n') 4043 self.exportChildren(outfile, level + 1, namespace_, name_) 4044 showIndent(outfile, level) 4045 outfile.write('</%s%s>\n' % (namespace_, name_)) 4046 else: 4047 outfile.write('/>\n')
4048 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='qualifier'):
4049 if self.qualifierID is not None and 'qualifierID' not in already_processed: 4050 already_processed.append('qualifierID') 4051 outfile.write(' qualifierID="%s"' % self.gds_format_integer(self.qualifierID, input_name='qualifierID')) 4052 if self.default is not None and 'default' not in already_processed: 4053 already_processed.append('default') 4054 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default')) 4055 if self.network is not None and 'network' not in already_processed: 4056 already_processed.append('network') 4057 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), )) 4058 if self.vocabulary is not None and 'vocabulary' not in already_processed: 4059 already_processed.append('vocabulary') 4060 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
4061 - def exportChildren(self, outfile, level, namespace_='', name_='qualifier'):
4062 if self.qualifierCode is not None: 4063 showIndent(outfile, level) 4064 outfile.write('<%squalifierCode>%s</%squalifierCode>\n' % (namespace_, self.gds_format_string(quote_xml(self.qualifierCode).encode(ExternalEncoding), input_name='qualifierCode'), namespace_))
4065 - def hasContent_(self):
4066 if ( 4067 self.qualifierCode is not None 4068 ): 4069 return True 4070 else: 4071 return False
4072 - def exportLiteral(self, outfile, level, name_='qualifier'):
4073 level += 1 4074 self.exportLiteralAttributes(outfile, level, [], name_) 4075 if self.hasContent_(): 4076 self.exportLiteralChildren(outfile, level, name_)
4077 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4078 if self.qualifierID is not None and 'qualifierID' not in already_processed: 4079 already_processed.append('qualifierID') 4080 showIndent(outfile, level) 4081 outfile.write('qualifierID = %d,\n' % (self.qualifierID,)) 4082 if self.default is not None and 'default' not in already_processed: 4083 already_processed.append('default') 4084 showIndent(outfile, level) 4085 outfile.write('default = %s,\n' % (self.default,)) 4086 if self.network is not None and 'network' not in already_processed: 4087 already_processed.append('network') 4088 showIndent(outfile, level) 4089 outfile.write('network = "%s",\n' % (self.network,)) 4090 if self.vocabulary is not None and 'vocabulary' not in already_processed: 4091 already_processed.append('vocabulary') 4092 showIndent(outfile, level) 4093 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
4094 - def exportLiteralChildren(self, outfile, level, name_):
4095 if self.qualifierCode is not None: 4096 showIndent(outfile, level) 4097 outfile.write('qualifierCode=%s,\n' % quote_python(self.qualifierCode).encode(ExternalEncoding))
4098 - def build(self, node):
4099 self.buildAttributes(node, node.attrib, []) 4100 for child in node: 4101 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4102 self.buildChildren(child, nodeName_)
4103 - def buildAttributes(self, node, attrs, already_processed):
4104 value = attrs.get('qualifierID') 4105 if value is not None and 'qualifierID' not in already_processed: 4106 already_processed.append('qualifierID') 4107 try: 4108 self.qualifierID = int(value) 4109 except ValueError, exp: 4110 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4111 value = attrs.get('default') 4112 if value is not None and 'default' not in already_processed: 4113 already_processed.append('default') 4114 if value in ('true', '1'): 4115 self.default = True 4116 elif value in ('false', '0'): 4117 self.default = False 4118 else: 4119 raise_parse_error(node, 'Bad boolean attribute') 4120 value = attrs.get('network') 4121 if value is not None and 'network' not in already_processed: 4122 already_processed.append('network') 4123 self.network = value 4124 value = attrs.get('vocabulary') 4125 if value is not None and 'vocabulary' not in already_processed: 4126 already_processed.append('vocabulary') 4127 self.vocabulary = value
4128 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4129 if nodeName_ == 'qualifierCode': 4130 qualifierCode_ = child_.text 4131 self.qualifierCode = qualifierCode_
4132 # end class qualifier 4133 4134
4135 -class TimeSeriesType(GeneratedsSuper):
4136 """Contains the source of the time series, the variable, and values 4137 element which is an array of value elements and thier associated 4138 metadata (qualifiers, methods, sources, quality control level, 4139 samples)Name of the time series. optional.""" 4140 subclass = None 4141 superclass = None
4142 - def __init__(self, name=None, sourceInfo=None, variable=None, values=None):
4143 self.name = _cast(None, name) 4144 self.sourceInfo = sourceInfo 4145 self.variable = variable 4146 self.values = values
4147 - def factory(*args_, **kwargs_):
4148 if TimeSeriesType.subclass: 4149 return TimeSeriesType.subclass(*args_, **kwargs_) 4150 else: 4151 return TimeSeriesType(*args_, **kwargs_)
4152 factory = staticmethod(factory)
4153 - def get_sourceInfo(self): return self.sourceInfo
4154 - def set_sourceInfo(self, sourceInfo): self.sourceInfo = sourceInfo
4155 - def get_variable(self): return self.variable
4156 - def set_variable(self, variable): self.variable = variable
4157 - def get_values(self): return self.values
4158 - def set_values(self, values): self.values = values
4159 - def get_name(self): return self.name
4160 - def set_name(self, name): self.name = name
4161 - def export(self, outfile, level, namespace_='', name_='TimeSeriesType', namespacedef_=''):
4162 showIndent(outfile, level) 4163 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4164 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSeriesType') 4165 if self.hasContent_(): 4166 outfile.write('>\n') 4167 self.exportChildren(outfile, level + 1, namespace_, name_) 4168 showIndent(outfile, level) 4169 outfile.write('</%s%s>\n' % (namespace_, name_)) 4170 else: 4171 outfile.write('/>\n')
4172 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSeriesType'):
4173 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
4174 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSeriesType'):
4175 if self.sourceInfo: 4176 self.sourceInfo.export(outfile, level, namespace_, name_='sourceInfo', ) 4177 if self.variable: 4178 self.variable.export(outfile, level, namespace_, name_='variable', ) 4179 if self.values: 4180 self.values.export(outfile, level, namespace_, name_='values', )
4181 - def hasContent_(self):
4182 if ( 4183 self.sourceInfo is not None or 4184 self.variable is not None or 4185 self.values is not None 4186 ): 4187 return True 4188 else: 4189 return False
4190 - def exportLiteral(self, outfile, level, name_='TimeSeriesType'):
4191 level += 1 4192 self.exportLiteralAttributes(outfile, level, [], name_) 4193 if self.hasContent_(): 4194 self.exportLiteralChildren(outfile, level, name_)
4195 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4196 if self.name is not None and 'name' not in already_processed: 4197 already_processed.append('name') 4198 showIndent(outfile, level) 4199 outfile.write('name = "%s",\n' % (self.name,))
4200 - def exportLiteralChildren(self, outfile, level, name_):
4201 if self.sourceInfo is not None: 4202 showIndent(outfile, level) 4203 outfile.write('sourceInfo=model_.SourceInfoType(\n') 4204 self.sourceInfo.exportLiteral(outfile, level, name_='sourceInfo') 4205 showIndent(outfile, level) 4206 outfile.write('),\n') 4207 if self.variable is not None: 4208 showIndent(outfile, level) 4209 outfile.write('variable=model_.VariableInfoType(\n') 4210 self.variable.exportLiteral(outfile, level, name_='variable') 4211 showIndent(outfile, level) 4212 outfile.write('),\n') 4213 if self.values is not None: 4214 showIndent(outfile, level) 4215 outfile.write('values=model_.TsValuesSingleVariableType(\n') 4216 self.values.exportLiteral(outfile, level, name_='values') 4217 showIndent(outfile, level) 4218 outfile.write('),\n')
4219 - def build(self, node):
4220 self.buildAttributes(node, node.attrib, []) 4221 for child in node: 4222 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4223 self.buildChildren(child, nodeName_)
4224 - def buildAttributes(self, node, attrs, already_processed):
4225 value = attrs.get('name') 4226 if value is not None and 'name' not in already_processed: 4227 already_processed.append('name') 4228 self.name = value
4229 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4230 if nodeName_ == 'sourceInfo': 4231 obj_ = SourceInfoType.factory() 4232 obj_.build(child_) 4233 self.set_sourceInfo(obj_) 4234 elif nodeName_ == 'variable': 4235 obj_ = VariableInfoType.factory() 4236 obj_.build(child_) 4237 self.set_variable(obj_) 4238 elif nodeName_ == 'values': 4239 obj_ = TsValuesSingleVariableType.factory() 4240 obj_.build(child_) 4241 self.set_values(obj_)
4242 # end class TimeSeriesType 4243 4244
4245 -class NoteType(GeneratedsSuper):
4246 """NoteType defines the note element available in many defined types. 4247 the value should be the description of the note. @title should be 4248 the brief name that might be displayed as a label. @type can be 4249 used to allow for grouping of elements.""" 4250 subclass = None 4251 superclass = None
4252 - def __init__(self, title=None, href=None, type_=None, show=None, valueOf_=None):
4253 self.title = _cast(None, title) 4254 self.href = _cast(None, href) 4255 self.type_ = _cast(None, type_) 4256 self.show = _cast(None, show) 4257 self.valueOf_ = valueOf_
4258 - def factory(*args_, **kwargs_):
4259 if NoteType.subclass: 4260 return NoteType.subclass(*args_, **kwargs_) 4261 else: 4262 return NoteType(*args_, **kwargs_)
4263 factory = staticmethod(factory)
4264 - def get_title(self): return self.title
4265 - def set_title(self, title): self.title = title
4266 - def get_href(self): return self.href
4267 - def set_href(self, href): self.href = href
4268 - def get_type(self): return self.type_
4269 - def set_type(self, type_): self.type_ = type_
4270 - def get_show(self): return self.show
4271 - def set_show(self, show): self.show = show
4272 - def get_valueOf_(self): return self.valueOf_
4273 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4274 - def export(self, outfile, level, namespace_='', name_='NoteType', namespacedef_=''):
4275 showIndent(outfile, level) 4276 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4277 self.exportAttributes(outfile, level, [], namespace_, name_='NoteType') 4278 if self.hasContent_(): 4279 outfile.write('>') 4280 outfile.write(self.valueOf_) 4281 self.exportChildren(outfile, level + 1, namespace_, name_) 4282 outfile.write('</%s%s>\n' % (namespace_, name_)) 4283 else: 4284 outfile.write('/>\n')
4285 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NoteType'):
4286 if self.title is not None and 'title' not in already_processed: 4287 already_processed.append('title') 4288 outfile.write(' title=%s' % (self.gds_format_string(quote_attrib(self.title).encode(ExternalEncoding), input_name='title'), )) 4289 if self.href is not None and 'href' not in already_processed: 4290 already_processed.append('href') 4291 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), )) 4292 if self.type_ is not None and 'type_' not in already_processed: 4293 already_processed.append('type_') 4294 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 4295 if self.show is not None and 'show' not in already_processed: 4296 already_processed.append('show') 4297 outfile.write(' show=%s' % (self.gds_format_string(quote_attrib(self.show).encode(ExternalEncoding), input_name='show'), ))
4298 - def exportChildren(self, outfile, level, namespace_='', name_='NoteType'):
4299 pass
4300 - def hasContent_(self):
4301 if ( 4302 self.valueOf_ 4303 ): 4304 return True 4305 else: 4306 return False
4307 - def exportLiteral(self, outfile, level, name_='NoteType'):
4308 level += 1 4309 self.exportLiteralAttributes(outfile, level, [], name_) 4310 if self.hasContent_(): 4311 self.exportLiteralChildren(outfile, level, name_) 4312 showIndent(outfile, level) 4313 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
4314 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4315 if self.title is not None and 'title' not in already_processed: 4316 already_processed.append('title') 4317 showIndent(outfile, level) 4318 outfile.write('title = "%s",\n' % (self.title,)) 4319 if self.href is not None and 'href' not in already_processed: 4320 already_processed.append('href') 4321 showIndent(outfile, level) 4322 outfile.write('href = "%s",\n' % (self.href,)) 4323 if self.type_ is not None and 'type_' not in already_processed: 4324 already_processed.append('type_') 4325 showIndent(outfile, level) 4326 outfile.write('type_ = "%s",\n' % (self.type_,)) 4327 if self.show is not None and 'show' not in already_processed: 4328 already_processed.append('show') 4329 showIndent(outfile, level) 4330 outfile.write('show = "%s",\n' % (self.show,))
4331 - def exportLiteralChildren(self, outfile, level, name_):
4332 pass
4333 - def build(self, node):
4334 self.buildAttributes(node, node.attrib, []) 4335 self.valueOf_ = get_all_text_(node) 4336 for child in node: 4337 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4338 self.buildChildren(child, nodeName_)
4339 - def buildAttributes(self, node, attrs, already_processed):
4340 value = attrs.get('title') 4341 if value is not None and 'title' not in already_processed: 4342 already_processed.append('title') 4343 self.title = value 4344 value = attrs.get('href') 4345 if value is not None and 'href' not in already_processed: 4346 already_processed.append('href') 4347 self.href = value 4348 value = attrs.get('type') 4349 if value is not None and 'type' not in already_processed: 4350 already_processed.append('type') 4351 self.type_ = value 4352 value = attrs.get('show') 4353 if value is not None and 'show' not in already_processed: 4354 already_processed.append('show') 4355 self.show = value
4356 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4357 pass
4358 # end class NoteType 4359 4360
4361 -class option(GeneratedsSuper):
4362 """Option elements are key-value pair elements that control how a 4363 variable maght be utilized in a service. Examples: MODIS web 4364 service. Information is aggreated over land or ocean or both. 4365 The plotarea option can include: plotarea=land, plotarea=land, 4366 plotarea=landocean USGS uses a statistic code, 0003, to repesent 4367 a value type of 'Average'. The USGS statistic codes also several 4368 options that do not fit the ODM data model.""" 4369 subclass = None 4370 superclass = None
4371 - def __init__(self, optionCode=None, optionID=None, name=None, valueOf_=None):
4372 self.optionCode = _cast(None, optionCode) 4373 self.optionID = _cast(int, optionID) 4374 self.name = _cast(None, name) 4375 self.valueOf_ = valueOf_
4376 - def factory(*args_, **kwargs_):
4377 if option.subclass: 4378 return option.subclass(*args_, **kwargs_) 4379 else: 4380 return option(*args_, **kwargs_)
4381 factory = staticmethod(factory)
4382 - def get_optionCode(self): return self.optionCode
4383 - def set_optionCode(self, optionCode): self.optionCode = optionCode
4384 - def get_optionID(self): return self.optionID
4385 - def set_optionID(self, optionID): self.optionID = optionID
4386 - def get_name(self): return self.name
4387 - def set_name(self, name): self.name = name
4388 - def get_valueOf_(self): return self.valueOf_
4389 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4390 - def export(self, outfile, level, namespace_='', name_='option', namespacedef_=''):
4391 showIndent(outfile, level) 4392 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4393 self.exportAttributes(outfile, level, [], namespace_, name_='option') 4394 if self.hasContent_(): 4395 outfile.write('>') 4396 outfile.write(self.valueOf_) 4397 self.exportChildren(outfile, level + 1, namespace_, name_) 4398 outfile.write('</%s%s>\n' % (namespace_, name_)) 4399 else: 4400 outfile.write('/>\n')
4401 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='option'):
4402 if self.optionCode is not None and 'optionCode' not in already_processed: 4403 already_processed.append('optionCode') 4404 outfile.write(' optionCode=%s' % (self.gds_format_string(quote_attrib(self.optionCode).encode(ExternalEncoding), input_name='optionCode'), )) 4405 if self.optionID is not None and 'optionID' not in already_processed: 4406 already_processed.append('optionID') 4407 outfile.write(' optionID="%s"' % self.gds_format_integer(self.optionID, input_name='optionID')) 4408 if self.name is not None and 'name' not in already_processed: 4409 already_processed.append('name') 4410 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
4411 - def exportChildren(self, outfile, level, namespace_='', name_='option'):
4412 pass
4413 - def hasContent_(self):
4414 if ( 4415 self.valueOf_ 4416 ): 4417 return True 4418 else: 4419 return False
4420 - def exportLiteral(self, outfile, level, name_='option'):
4421 level += 1 4422 self.exportLiteralAttributes(outfile, level, [], name_) 4423 if self.hasContent_(): 4424 self.exportLiteralChildren(outfile, level, name_) 4425 showIndent(outfile, level) 4426 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
4427 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4428 if self.optionCode is not None and 'optionCode' not in already_processed: 4429 already_processed.append('optionCode') 4430 showIndent(outfile, level) 4431 outfile.write('optionCode = "%s",\n' % (self.optionCode,)) 4432 if self.optionID is not None and 'optionID' not in already_processed: 4433 already_processed.append('optionID') 4434 showIndent(outfile, level) 4435 outfile.write('optionID = %d,\n' % (self.optionID,)) 4436 if self.name is not None and 'name' not in already_processed: 4437 already_processed.append('name') 4438 showIndent(outfile, level) 4439 outfile.write('name = "%s",\n' % (self.name,))
4440 - def exportLiteralChildren(self, outfile, level, name_):
4441 pass
4442 - def build(self, node):
4443 self.buildAttributes(node, node.attrib, []) 4444 self.valueOf_ = get_all_text_(node) 4445 for child in node: 4446 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4447 self.buildChildren(child, nodeName_)
4448 - def buildAttributes(self, node, attrs, already_processed):
4449 value = attrs.get('optionCode') 4450 if value is not None and 'optionCode' not in already_processed: 4451 already_processed.append('optionCode') 4452 self.optionCode = value 4453 self.optionCode = ' '.join(self.optionCode.split()) 4454 value = attrs.get('optionID') 4455 if value is not None and 'optionID' not in already_processed: 4456 already_processed.append('optionID') 4457 try: 4458 self.optionID = int(value) 4459 except ValueError, exp: 4460 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4461 value = attrs.get('name') 4462 if value is not None and 'name' not in already_processed: 4463 already_processed.append('name') 4464 self.name = value
4465 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4466 pass
4467 # end class option 4468 4469
4470 -class variableCode(GeneratedsSuper):
4471 """Text code used by the organization that collects the data to 4472 identify the variable. The attribute @vocabulary must be set to 4473 the data source name, so the clients can subbumit variable 4474 requests to a web service (net USGS discharge variableCode 4475 @vocabularyk=NWISDV @default=true “00060”""" 4476 subclass = None 4477 superclass = None
4478 - def __init__(self, default=None, variableID=None, vocabulary=None, network=None, valueOf_=None):
4479 self.default = _cast(bool, default) 4480 self.variableID = _cast(int, variableID) 4481 self.vocabulary = _cast(None, vocabulary) 4482 self.network = _cast(None, network) 4483 self.valueOf_ = valueOf_
4484 - def factory(*args_, **kwargs_):
4485 if variableCode.subclass: 4486 return variableCode.subclass(*args_, **kwargs_) 4487 else: 4488 return variableCode(*args_, **kwargs_)
4489 factory = staticmethod(factory)
4490 - def get_default(self): return self.default
4491 - def set_default(self, default): self.default = default
4492 - def get_variableID(self): return self.variableID
4493 - def set_variableID(self, variableID): self.variableID = variableID
4494 - def get_vocabulary(self): return self.vocabulary
4495 - def set_vocabulary(self, vocabulary): self.vocabulary = vocabulary
4496 - def get_network(self): return self.network
4497 - def set_network(self, network): self.network = network
4498 - def get_valueOf_(self): return self.valueOf_
4499 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4500 - def export(self, outfile, level, namespace_='', name_='variableCode', namespacedef_=''):
4501 showIndent(outfile, level) 4502 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4503 self.exportAttributes(outfile, level, [], namespace_, name_='variableCode') 4504 if self.hasContent_(): 4505 outfile.write('>') 4506 outfile.write(self.valueOf_) 4507 self.exportChildren(outfile, level + 1, namespace_, name_) 4508 outfile.write('</%s%s>\n' % (namespace_, name_)) 4509 else: 4510 outfile.write('/>\n')
4511 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='variableCode'):
4512 if self.default is not None and 'default' not in already_processed: 4513 already_processed.append('default') 4514 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default')) 4515 if self.variableID is not None and 'variableID' not in already_processed: 4516 already_processed.append('variableID') 4517 outfile.write(' variableID="%s"' % self.gds_format_integer(self.variableID, input_name='variableID')) 4518 if self.vocabulary is not None and 'vocabulary' not in already_processed: 4519 already_processed.append('vocabulary') 4520 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), )) 4521 if self.network is not None and 'network' not in already_processed: 4522 already_processed.append('network') 4523 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), ))
4524 - def exportChildren(self, outfile, level, namespace_='', name_='variableCode'):
4525 pass
4526 - def hasContent_(self):
4527 if ( 4528 self.valueOf_ 4529 ): 4530 return True 4531 else: 4532 return False
4533 - def exportLiteral(self, outfile, level, name_='variableCode'):
4534 level += 1 4535 self.exportLiteralAttributes(outfile, level, [], name_) 4536 if self.hasContent_(): 4537 self.exportLiteralChildren(outfile, level, name_) 4538 showIndent(outfile, level) 4539 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
4540 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4541 if self.default is not None and 'default' not in already_processed: 4542 already_processed.append('default') 4543 showIndent(outfile, level) 4544 outfile.write('default = %s,\n' % (self.default,)) 4545 if self.variableID is not None and 'variableID' not in already_processed: 4546 already_processed.append('variableID') 4547 showIndent(outfile, level) 4548 outfile.write('variableID = %d,\n' % (self.variableID,)) 4549 if self.vocabulary is not None and 'vocabulary' not in already_processed: 4550 already_processed.append('vocabulary') 4551 showIndent(outfile, level) 4552 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,)) 4553 if self.network is not None and 'network' not in already_processed: 4554 already_processed.append('network') 4555 showIndent(outfile, level) 4556 outfile.write('network = "%s",\n' % (self.network,))
4557 - def exportLiteralChildren(self, outfile, level, name_):
4558 pass
4559 - def build(self, node):
4560 self.buildAttributes(node, node.attrib, []) 4561 self.valueOf_ = get_all_text_(node) 4562 for child in node: 4563 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4564 self.buildChildren(child, nodeName_)
4565 - def buildAttributes(self, node, attrs, already_processed):
4566 value = attrs.get('default') 4567 if value is not None and 'default' not in already_processed: 4568 already_processed.append('default') 4569 if value in ('true', '1'): 4570 self.default = True 4571 elif value in ('false', '0'): 4572 self.default = False 4573 else: 4574 raise_parse_error(node, 'Bad boolean attribute') 4575 value = attrs.get('variableID') 4576 if value is not None and 'variableID' not in already_processed: 4577 already_processed.append('variableID') 4578 try: 4579 self.variableID = int(value) 4580 except ValueError, exp: 4581 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4582 value = attrs.get('vocabulary') 4583 if value is not None and 'vocabulary' not in already_processed: 4584 already_processed.append('vocabulary') 4585 self.vocabulary = value 4586 value = attrs.get('network') 4587 if value is not None and 'network' not in already_processed: 4588 already_processed.append('network') 4589 self.network = value
4590 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4591 pass
4592 # end class variableCode 4593 4594
4595 -class units(GeneratedsSuper):
4596 subclass = None 4597 superclass = None
4598 - def __init__(self, unitsAbbreviation=None, unitsCode=None, unitsType=None, valueOf_=None):
4599 self.unitsAbbreviation = _cast(None, unitsAbbreviation) 4600 self.unitsCode = _cast(None, unitsCode) 4601 self.unitsType = _cast(None, unitsType) 4602 self.valueOf_ = valueOf_
4603 - def factory(*args_, **kwargs_):
4604 if units.subclass: 4605 return units.subclass(*args_, **kwargs_) 4606 else: 4607 return units(*args_, **kwargs_)
4608 factory = staticmethod(factory)
4609 - def get_unitsAbbreviation(self): return self.unitsAbbreviation
4610 - def set_unitsAbbreviation(self, unitsAbbreviation): self.unitsAbbreviation = unitsAbbreviation
4611 - def get_unitsCode(self): return self.unitsCode
4612 - def set_unitsCode(self, unitsCode): self.unitsCode = unitsCode
4613 - def get_unitsType(self): return self.unitsType
4614 - def set_unitsType(self, unitsType): self.unitsType = unitsType
4615 - def validate_UnitsTypeEnum(self, value):
4616 # Validate type UnitsTypeEnum, a restriction on xsi:string. 4617 pass
4618 - def get_valueOf_(self): return self.valueOf_
4619 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4620 - def export(self, outfile, level, namespace_='', name_='units', namespacedef_=''):
4621 showIndent(outfile, level) 4622 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4623 self.exportAttributes(outfile, level, [], namespace_, name_='units') 4624 if self.hasContent_(): 4625 outfile.write('>') 4626 outfile.write(self.valueOf_) 4627 self.exportChildren(outfile, level + 1, namespace_, name_) 4628 outfile.write('</%s%s>\n' % (namespace_, name_)) 4629 else: 4630 outfile.write('/>\n')
4631 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='units'):
4632 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed: 4633 already_processed.append('unitsAbbreviation') 4634 outfile.write(' unitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.unitsAbbreviation).encode(ExternalEncoding), input_name='unitsAbbreviation'), )) 4635 if self.unitsCode is not None and 'unitsCode' not in already_processed: 4636 already_processed.append('unitsCode') 4637 outfile.write(' unitsCode=%s' % (self.gds_format_string(quote_attrib(self.unitsCode).encode(ExternalEncoding), input_name='unitsCode'), )) 4638 if self.unitsType is not None and 'unitsType' not in already_processed: 4639 already_processed.append('unitsType') 4640 outfile.write(' unitsType=%s' % (quote_attrib(self.unitsType), ))
4641 - def exportChildren(self, outfile, level, namespace_='', name_='units'):
4642 pass
4643 - def hasContent_(self):
4644 if ( 4645 self.valueOf_ 4646 ): 4647 return True 4648 else: 4649 return False
4650 - def exportLiteral(self, outfile, level, name_='units'):
4651 level += 1 4652 self.exportLiteralAttributes(outfile, level, [], name_) 4653 if self.hasContent_(): 4654 self.exportLiteralChildren(outfile, level, name_) 4655 showIndent(outfile, level) 4656 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
4657 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4658 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed: 4659 already_processed.append('unitsAbbreviation') 4660 showIndent(outfile, level) 4661 outfile.write('unitsAbbreviation = "%s",\n' % (self.unitsAbbreviation,)) 4662 if self.unitsCode is not None and 'unitsCode' not in already_processed: 4663 already_processed.append('unitsCode') 4664 showIndent(outfile, level) 4665 outfile.write('unitsCode = "%s",\n' % (self.unitsCode,)) 4666 if self.unitsType is not None and 'unitsType' not in already_processed: 4667 already_processed.append('unitsType') 4668 showIndent(outfile, level) 4669 outfile.write('unitsType = "%s",\n' % (self.unitsType,))
4670 - def exportLiteralChildren(self, outfile, level, name_):
4671 pass
4672 - def build(self, node):
4673 self.buildAttributes(node, node.attrib, []) 4674 self.valueOf_ = get_all_text_(node) 4675 for child in node: 4676 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4677 self.buildChildren(child, nodeName_)
4678 - def buildAttributes(self, node, attrs, already_processed):
4679 value = attrs.get('unitsAbbreviation') 4680 if value is not None and 'unitsAbbreviation' not in already_processed: 4681 already_processed.append('unitsAbbreviation') 4682 self.unitsAbbreviation = value 4683 value = attrs.get('unitsCode') 4684 if value is not None and 'unitsCode' not in already_processed: 4685 already_processed.append('unitsCode') 4686 self.unitsCode = value 4687 self.unitsCode = ' '.join(self.unitsCode.split()) 4688 value = attrs.get('unitsType') 4689 if value is not None and 'unitsType' not in already_processed: 4690 already_processed.append('unitsType') 4691 self.unitsType = value
4692 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4693 pass
4694 # end class units 4695 4696
4697 -class ValueSingleVariable(GeneratedsSuper):
4698 subclass = None 4699 superclass = None
4700 - def __init__(self, codedVocabularyTerm=None, metadataDateTime=None, qualityControlLevel=None, methodID=None, codedVocabulary=None, sourceID=None, oid=None, censorCode=None, offsetDescription=None, sampleID=None, offsetTypeID=None, accuracyStdDev=None, offsetUnitsAbbreviation=None, offsetValue=None, dateTime=None, qualifiers=None, offsetUnitsCode=None, valueOf_=None):
4701 self.codedVocabularyTerm = _cast(None, codedVocabularyTerm) 4702 self.metadataDateTime = _cast(None, metadataDateTime) 4703 self.qualityControlLevel = _cast(None, qualityControlLevel) 4704 self.methodID = _cast(int, methodID) 4705 self.codedVocabulary = _cast(bool, codedVocabulary) 4706 self.sourceID = _cast(int, sourceID) 4707 self.oid = _cast(None, oid) 4708 self.censorCode = _cast(None, censorCode) 4709 self.offsetDescription = _cast(None, offsetDescription) 4710 self.sampleID = _cast(int, sampleID) 4711 self.offsetTypeID = _cast(int, offsetTypeID) 4712 self.accuracyStdDev = _cast(float, accuracyStdDev) 4713 self.offsetUnitsAbbreviation = _cast(None, offsetUnitsAbbreviation) 4714 self.offsetValue = _cast(float, offsetValue) 4715 self.dateTime = _cast(None, dateTime) 4716 self.qualifiers = _cast(None, qualifiers) 4717 self.offsetUnitsCode = _cast(None, offsetUnitsCode) 4718 self.valueOf_ = valueOf_
4719 - def factory(*args_, **kwargs_):
4720 if ValueSingleVariable.subclass: 4721 return ValueSingleVariable.subclass(*args_, **kwargs_) 4722 else: 4723 return ValueSingleVariable(*args_, **kwargs_)
4724 factory = staticmethod(factory)
4725 - def get_codedVocabularyTerm(self): return self.codedVocabularyTerm
4726 - def set_codedVocabularyTerm(self, codedVocabularyTerm): self.codedVocabularyTerm = codedVocabularyTerm
4727 - def get_metadataDateTime(self): return self.metadataDateTime
4728 - def set_metadataDateTime(self, metadataDateTime): self.metadataDateTime = metadataDateTime
4729 - def get_qualityControlLevel(self): return self.qualityControlLevel
4730 - def set_qualityControlLevel(self, qualityControlLevel): self.qualityControlLevel = qualityControlLevel
4731 - def validate_QualityControlLevelEnum(self, value):
4732 # Validate type QualityControlLevelEnum, a restriction on xsi:string. 4733 pass
4734 - def get_methodID(self): return self.methodID
4735 - def set_methodID(self, methodID): self.methodID = methodID
4736 - def get_codedVocabulary(self): return self.codedVocabulary
4737 - def set_codedVocabulary(self, codedVocabulary): self.codedVocabulary = codedVocabulary
4738 - def get_sourceID(self): return self.sourceID
4739 - def set_sourceID(self, sourceID): self.sourceID = sourceID
4740 - def get_oid(self): return self.oid
4741 - def set_oid(self, oid): self.oid = oid
4742 - def get_censorCode(self): return self.censorCode
4743 - def set_censorCode(self, censorCode): self.censorCode = censorCode
4744 - def validate_CensorCodeEnum(self, value):
4745 # Validate type CensorCodeEnum, a restriction on xsi:string. 4746 pass
4747 - def get_offsetDescription(self): return self.offsetDescription
4748 - def set_offsetDescription(self, offsetDescription): self.offsetDescription = offsetDescription
4749 - def get_sampleID(self): return self.sampleID
4750 - def set_sampleID(self, sampleID): self.sampleID = sampleID
4751 - def get_offsetTypeID(self): return self.offsetTypeID
4752 - def set_offsetTypeID(self, offsetTypeID): self.offsetTypeID = offsetTypeID
4753 - def get_accuracyStdDev(self): return self.accuracyStdDev
4754 - def set_accuracyStdDev(self, accuracyStdDev): self.accuracyStdDev = accuracyStdDev
4755 - def get_offsetUnitsAbbreviation(self): return self.offsetUnitsAbbreviation
4756 - def set_offsetUnitsAbbreviation(self, offsetUnitsAbbreviation): self.offsetUnitsAbbreviation = offsetUnitsAbbreviation
4757 - def get_offsetValue(self): return self.offsetValue
4758 - def set_offsetValue(self, offsetValue): self.offsetValue = offsetValue
4759 - def get_dateTime(self): return self.dateTime
4760 - def set_dateTime(self, dateTime): self.dateTime = dateTime
4761 - def get_qualifiers(self): return self.qualifiers
4762 - def set_qualifiers(self, qualifiers): self.qualifiers = qualifiers
4763 - def get_offsetUnitsCode(self): return self.offsetUnitsCode
4764 - def set_offsetUnitsCode(self, offsetUnitsCode): self.offsetUnitsCode = offsetUnitsCode
4765 - def get_valueOf_(self): return self.valueOf_
4766 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4767 - def export(self, outfile, level, namespace_='', name_='ValueSingleVariable', namespacedef_=''):
4768 showIndent(outfile, level) 4769 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4770 self.exportAttributes(outfile, level, [], namespace_, name_='ValueSingleVariable') 4771 if self.hasContent_(): 4772 outfile.write('>') 4773 outfile.write(self.valueOf_) 4774 self.exportChildren(outfile, level + 1, namespace_, name_) 4775 outfile.write('</%s%s>\n' % (namespace_, name_)) 4776 else: 4777 outfile.write('/>\n')
4778 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ValueSingleVariable'):
4779 if self.codedVocabularyTerm is not None and 'codedVocabularyTerm' not in already_processed: 4780 already_processed.append('codedVocabularyTerm') 4781 outfile.write(' codedVocabularyTerm=%s' % (self.gds_format_string(quote_attrib(self.codedVocabularyTerm).encode(ExternalEncoding), input_name='codedVocabularyTerm'), )) 4782 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 4783 already_processed.append('metadataDateTime') 4784 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), )) 4785 if self.qualityControlLevel is not None and 'qualityControlLevel' not in already_processed: 4786 already_processed.append('qualityControlLevel') 4787 outfile.write(' qualityControlLevel=%s' % (quote_attrib(self.qualityControlLevel), )) 4788 if self.methodID is not None and 'methodID' not in already_processed: 4789 already_processed.append('methodID') 4790 outfile.write(' methodID="%s"' % self.gds_format_integer(self.methodID, input_name='methodID')) 4791 if self.codedVocabulary is not None and 'codedVocabulary' not in already_processed: 4792 already_processed.append('codedVocabulary') 4793 outfile.write(' codedVocabulary="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.codedVocabulary)), input_name='codedVocabulary')) 4794 if self.sourceID is not None and 'sourceID' not in already_processed: 4795 already_processed.append('sourceID') 4796 outfile.write(' sourceID="%s"' % self.gds_format_integer(self.sourceID, input_name='sourceID')) 4797 if self.oid is not None and 'oid' not in already_processed: 4798 already_processed.append('oid') 4799 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), )) 4800 if self.censorCode is not None and 'censorCode' not in already_processed: 4801 already_processed.append('censorCode') 4802 outfile.write(' censorCode=%s' % (quote_attrib(self.censorCode), )) 4803 if self.offsetDescription is not None and 'offsetDescription' not in already_processed: 4804 already_processed.append('offsetDescription') 4805 outfile.write(' offsetDescription=%s' % (self.gds_format_string(quote_attrib(self.offsetDescription).encode(ExternalEncoding), input_name='offsetDescription'), )) 4806 if self.sampleID is not None and 'sampleID' not in already_processed: 4807 already_processed.append('sampleID') 4808 outfile.write(' sampleID="%s"' % self.gds_format_integer(self.sampleID, input_name='sampleID')) 4809 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed: 4810 already_processed.append('offsetTypeID') 4811 outfile.write(' offsetTypeID="%s"' % self.gds_format_integer(self.offsetTypeID, input_name='offsetTypeID')) 4812 if self.accuracyStdDev is not None and 'accuracyStdDev' not in already_processed: 4813 already_processed.append('accuracyStdDev') 4814 outfile.write(' accuracyStdDev="%s"' % self.gds_format_double(self.accuracyStdDev, input_name='accuracyStdDev')) 4815 if self.offsetUnitsAbbreviation is not None and 'offsetUnitsAbbreviation' not in already_processed: 4816 already_processed.append('offsetUnitsAbbreviation') 4817 outfile.write(' offsetUnitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.offsetUnitsAbbreviation).encode(ExternalEncoding), input_name='offsetUnitsAbbreviation'), )) 4818 if self.offsetValue is not None and 'offsetValue' not in already_processed: 4819 already_processed.append('offsetValue') 4820 outfile.write(' offsetValue="%s"' % self.gds_format_double(self.offsetValue, input_name='offsetValue')) 4821 outfile.write(' dateTime=%s' % (self.gds_format_string(quote_attrib(self.dateTime).encode(ExternalEncoding), input_name='dateTime'), )) 4822 if self.qualifiers is not None and 'qualifiers' not in already_processed: 4823 already_processed.append('qualifiers') 4824 outfile.write(' qualifiers=%s' % (self.gds_format_string(quote_attrib(self.qualifiers).encode(ExternalEncoding), input_name='qualifiers'), )) 4825 if self.offsetUnitsCode is not None and 'offsetUnitsCode' not in already_processed: 4826 already_processed.append('offsetUnitsCode') 4827 outfile.write(' offsetUnitsCode=%s' % (self.gds_format_string(quote_attrib(self.offsetUnitsCode).encode(ExternalEncoding), input_name='offsetUnitsCode'), ))
4828 - def exportChildren(self, outfile, level, namespace_='', name_='ValueSingleVariable'):
4829 pass
4830 - def hasContent_(self):
4831 if ( 4832 self.valueOf_ 4833 ): 4834 return True 4835 else: 4836 return False
4837 - def exportLiteral(self, outfile, level, name_='ValueSingleVariable'):
4838 level += 1 4839 self.exportLiteralAttributes(outfile, level, [], name_) 4840 if self.hasContent_(): 4841 self.exportLiteralChildren(outfile, level, name_) 4842 showIndent(outfile, level) 4843 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
4844 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4845 if self.codedVocabularyTerm is not None and 'codedVocabularyTerm' not in already_processed: 4846 already_processed.append('codedVocabularyTerm') 4847 showIndent(outfile, level) 4848 outfile.write('codedVocabularyTerm = "%s",\n' % (self.codedVocabularyTerm,)) 4849 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 4850 already_processed.append('metadataDateTime') 4851 showIndent(outfile, level) 4852 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,)) 4853 if self.qualityControlLevel is not None and 'qualityControlLevel' not in already_processed: 4854 already_processed.append('qualityControlLevel') 4855 showIndent(outfile, level) 4856 outfile.write('qualityControlLevel = "%s",\n' % (self.qualityControlLevel,)) 4857 if self.methodID is not None and 'methodID' not in already_processed: 4858 already_processed.append('methodID') 4859 showIndent(outfile, level) 4860 outfile.write('methodID = %d,\n' % (self.methodID,)) 4861 if self.codedVocabulary is not None and 'codedVocabulary' not in already_processed: 4862 already_processed.append('codedVocabulary') 4863 showIndent(outfile, level) 4864 outfile.write('codedVocabulary = %s,\n' % (self.codedVocabulary,)) 4865 if self.sourceID is not None and 'sourceID' not in already_processed: 4866 already_processed.append('sourceID') 4867 showIndent(outfile, level) 4868 outfile.write('sourceID = %d,\n' % (self.sourceID,)) 4869 if self.oid is not None and 'oid' not in already_processed: 4870 already_processed.append('oid') 4871 showIndent(outfile, level) 4872 outfile.write('oid = "%s",\n' % (self.oid,)) 4873 if self.censorCode is not None and 'censorCode' not in already_processed: 4874 already_processed.append('censorCode') 4875 showIndent(outfile, level) 4876 outfile.write('censorCode = "%s",\n' % (self.censorCode,)) 4877 if self.offsetDescription is not None and 'offsetDescription' not in already_processed: 4878 already_processed.append('offsetDescription') 4879 showIndent(outfile, level) 4880 outfile.write('offsetDescription = "%s",\n' % (self.offsetDescription,)) 4881 if self.sampleID is not None and 'sampleID' not in already_processed: 4882 already_processed.append('sampleID') 4883 showIndent(outfile, level) 4884 outfile.write('sampleID = %d,\n' % (self.sampleID,)) 4885 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed: 4886 already_processed.append('offsetTypeID') 4887 showIndent(outfile, level) 4888 outfile.write('offsetTypeID = %d,\n' % (self.offsetTypeID,)) 4889 if self.accuracyStdDev is not None and 'accuracyStdDev' not in already_processed: 4890 already_processed.append('accuracyStdDev') 4891 showIndent(outfile, level) 4892 outfile.write('accuracyStdDev = %e,\n' % (self.accuracyStdDev,)) 4893 if self.offsetUnitsAbbreviation is not None and 'offsetUnitsAbbreviation' not in already_processed: 4894 already_processed.append('offsetUnitsAbbreviation') 4895 showIndent(outfile, level) 4896 outfile.write('offsetUnitsAbbreviation = "%s",\n' % (self.offsetUnitsAbbreviation,)) 4897 if self.offsetValue is not None and 'offsetValue' not in already_processed: 4898 already_processed.append('offsetValue') 4899 showIndent(outfile, level) 4900 outfile.write('offsetValue = %e,\n' % (self.offsetValue,)) 4901 if self.dateTime is not None and 'dateTime' not in already_processed: 4902 already_processed.append('dateTime') 4903 showIndent(outfile, level) 4904 outfile.write('dateTime = "%s",\n' % (self.dateTime,)) 4905 if self.qualifiers is not None and 'qualifiers' not in already_processed: 4906 already_processed.append('qualifiers') 4907 showIndent(outfile, level) 4908 outfile.write('qualifiers = "%s",\n' % (self.qualifiers,)) 4909 if self.offsetUnitsCode is not None and 'offsetUnitsCode' not in already_processed: 4910 already_processed.append('offsetUnitsCode') 4911 showIndent(outfile, level) 4912 outfile.write('offsetUnitsCode = "%s",\n' % (self.offsetUnitsCode,))
4913 - def exportLiteralChildren(self, outfile, level, name_):
4914 pass
4915 - def build(self, node):
4916 self.buildAttributes(node, node.attrib, []) 4917 self.valueOf_ = get_all_text_(node) 4918 for child in node: 4919 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4920 self.buildChildren(child, nodeName_)
4921 - def buildAttributes(self, node, attrs, already_processed):
4922 value = attrs.get('codedVocabularyTerm') 4923 if value is not None and 'codedVocabularyTerm' not in already_processed: 4924 already_processed.append('codedVocabularyTerm') 4925 self.codedVocabularyTerm = value 4926 value = attrs.get('metadataDateTime') 4927 if value is not None and 'metadataDateTime' not in already_processed: 4928 already_processed.append('metadataDateTime') 4929 self.metadataDateTime = value 4930 value = attrs.get('qualityControlLevel') 4931 if value is not None and 'qualityControlLevel' not in already_processed: 4932 already_processed.append('qualityControlLevel') 4933 self.qualityControlLevel = value 4934 value = attrs.get('methodID') 4935 if value is not None and 'methodID' not in already_processed: 4936 already_processed.append('methodID') 4937 try: 4938 self.methodID = int(value) 4939 except ValueError, exp: 4940 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4941 value = attrs.get('codedVocabulary') 4942 if value is not None and 'codedVocabulary' not in already_processed: 4943 already_processed.append('codedVocabulary') 4944 if value in ('true', '1'): 4945 self.codedVocabulary = True 4946 elif value in ('false', '0'): 4947 self.codedVocabulary = False 4948 else: 4949 raise_parse_error(node, 'Bad boolean attribute') 4950 value = attrs.get('sourceID') 4951 if value is not None and 'sourceID' not in already_processed: 4952 already_processed.append('sourceID') 4953 try: 4954 self.sourceID = int(value) 4955 except ValueError, exp: 4956 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4957 value = attrs.get('oid') 4958 if value is not None and 'oid' not in already_processed: 4959 already_processed.append('oid') 4960 self.oid = value 4961 value = attrs.get('censorCode') 4962 if value is not None and 'censorCode' not in already_processed: 4963 already_processed.append('censorCode') 4964 self.censorCode = value 4965 value = attrs.get('offsetDescription') 4966 if value is not None and 'offsetDescription' not in already_processed: 4967 already_processed.append('offsetDescription') 4968 self.offsetDescription = value 4969 value = attrs.get('sampleID') 4970 if value is not None and 'sampleID' not in already_processed: 4971 already_processed.append('sampleID') 4972 try: 4973 self.sampleID = int(value) 4974 except ValueError, exp: 4975 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4976 value = attrs.get('offsetTypeID') 4977 if value is not None and 'offsetTypeID' not in already_processed: 4978 already_processed.append('offsetTypeID') 4979 try: 4980 self.offsetTypeID = int(value) 4981 except ValueError, exp: 4982 raise_parse_error(node, 'Bad integer attribute: %s' % exp) 4983 value = attrs.get('accuracyStdDev') 4984 if value is not None and 'accuracyStdDev' not in already_processed: 4985 already_processed.append('accuracyStdDev') 4986 try: 4987 self.accuracyStdDev = float(value) 4988 except ValueError, exp: 4989 raise ValueError('Bad float/double attribute (accuracyStdDev): %s' % exp) 4990 value = attrs.get('offsetUnitsAbbreviation') 4991 if value is not None and 'offsetUnitsAbbreviation' not in already_processed: 4992 already_processed.append('offsetUnitsAbbreviation') 4993 self.offsetUnitsAbbreviation = value 4994 value = attrs.get('offsetValue') 4995 if value is not None and 'offsetValue' not in already_processed: 4996 already_processed.append('offsetValue') 4997 try: 4998 self.offsetValue = float(value) 4999 except ValueError, exp: 5000 raise ValueError('Bad float/double attribute (offsetValue): %s' % exp) 5001 value = attrs.get('dateTime') 5002 if value is not None and 'dateTime' not in already_processed: 5003 already_processed.append('dateTime') 5004 self.dateTime = value 5005 value = attrs.get('qualifiers') 5006 if value is not None and 'qualifiers' not in already_processed: 5007 already_processed.append('qualifiers') 5008 self.qualifiers = value 5009 value = attrs.get('offsetUnitsCode') 5010 if value is not None and 'offsetUnitsCode' not in already_processed: 5011 already_processed.append('offsetUnitsCode') 5012 self.offsetUnitsCode = value
5013 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5014 pass
5015 # end class ValueSingleVariable 5016 5017
5018 -class VariablesResponseType(GeneratedsSuper):
5019 """VariablesResponseType is object type returned by the method 5020 GetVariableInfo. The elemnt name is variablesResponse. The 5021 request will contain a variables element containing a list of 5022 variable elements.""" 5023 subclass = None 5024 superclass = None
5025 - def __init__(self, queryInfo=None, variables=None):
5026 self.queryInfo = queryInfo 5027 self.variables = variables
5028 - def factory(*args_, **kwargs_):
5029 if VariablesResponseType.subclass: 5030 return VariablesResponseType.subclass(*args_, **kwargs_) 5031 else: 5032 return VariablesResponseType(*args_, **kwargs_)
5033 factory = staticmethod(factory)
5034 - def get_queryInfo(self): return self.queryInfo
5035 - def set_queryInfo(self, queryInfo): self.queryInfo = queryInfo
5036 - def get_variables(self): return self.variables
5037 - def set_variables(self, variables): self.variables = variables
5038 - def export(self, outfile, level, namespace_='', name_='VariablesResponseType', namespacedef_=''):
5039 showIndent(outfile, level) 5040 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5041 self.exportAttributes(outfile, level, [], namespace_, name_='VariablesResponseType') 5042 if self.hasContent_(): 5043 outfile.write('>\n') 5044 self.exportChildren(outfile, level + 1, namespace_, name_) 5045 showIndent(outfile, level) 5046 outfile.write('</%s%s>\n' % (namespace_, name_)) 5047 else: 5048 outfile.write('/>\n')
5049 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='VariablesResponseType'):
5050 pass
5051 - def exportChildren(self, outfile, level, namespace_='', name_='VariablesResponseType'):
5052 if self.queryInfo: 5053 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', ) 5054 if self.variables: 5055 self.variables.export(outfile, level, namespace_, name_='variables', )
5056 - def hasContent_(self):
5057 if ( 5058 self.queryInfo is not None or 5059 self.variables is not None 5060 ): 5061 return True 5062 else: 5063 return False
5064 - def exportLiteral(self, outfile, level, name_='VariablesResponseType'):
5065 level += 1 5066 self.exportLiteralAttributes(outfile, level, [], name_) 5067 if self.hasContent_(): 5068 self.exportLiteralChildren(outfile, level, name_)
5069 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5070 pass
5071 - def exportLiteralChildren(self, outfile, level, name_):
5072 if self.queryInfo is not None: 5073 showIndent(outfile, level) 5074 outfile.write('queryInfo=model_.QueryInfoType(\n') 5075 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo') 5076 showIndent(outfile, level) 5077 outfile.write('),\n') 5078 if self.variables is not None: 5079 showIndent(outfile, level) 5080 outfile.write('variables=model_.variables(\n') 5081 self.variables.exportLiteral(outfile, level) 5082 showIndent(outfile, level) 5083 outfile.write('),\n')
5084 - def build(self, node):
5085 self.buildAttributes(node, node.attrib, []) 5086 for child in node: 5087 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5088 self.buildChildren(child, nodeName_)
5089 - def buildAttributes(self, node, attrs, already_processed):
5090 pass
5091 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5092 if nodeName_ == 'queryInfo': 5093 obj_ = QueryInfoType.factory() 5094 obj_.build(child_) 5095 self.set_queryInfo(obj_) 5096 elif nodeName_ == 'variables': 5097 obj_ = variables.factory() 5098 obj_.build(child_) 5099 self.set_variables(obj_)
5100 # end class VariablesResponseType 5101 5102
5103 -class TimeSeriesResponseType(GeneratedsSuper):
5104 subclass = None 5105 superclass = None
5106 - def __init__(self, queryInfo=None, timeSeries=None):
5107 self.queryInfo = queryInfo 5108 self.timeSeries = timeSeries
5109 - def factory(*args_, **kwargs_):
5110 if TimeSeriesResponseType.subclass: 5111 return TimeSeriesResponseType.subclass(*args_, **kwargs_) 5112 else: 5113 return TimeSeriesResponseType(*args_, **kwargs_)
5114 factory = staticmethod(factory)
5115 - def get_queryInfo(self): return self.queryInfo
5116 - def set_queryInfo(self, queryInfo): self.queryInfo = queryInfo
5117 - def get_timeSeries(self): return self.timeSeries
5118 - def set_timeSeries(self, timeSeries): self.timeSeries = timeSeries
5119 - def export(self, outfile, level, namespace_='', name_='TimeSeriesResponseType', namespacedef_=''):
5120 showIndent(outfile, level) 5121 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5122 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSeriesResponseType') 5123 if self.hasContent_(): 5124 outfile.write('>\n') 5125 self.exportChildren(outfile, level + 1, namespace_, name_) 5126 showIndent(outfile, level) 5127 outfile.write('</%s%s>\n' % (namespace_, name_)) 5128 else: 5129 outfile.write('/>\n')
5130 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSeriesResponseType'):
5131 pass
5132 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSeriesResponseType'):
5133 if self.queryInfo: 5134 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', ) 5135 if self.timeSeries: 5136 self.timeSeries.export(outfile, level, namespace_, name_='timeSeries', )
5137 - def hasContent_(self):
5138 if ( 5139 self.queryInfo is not None or 5140 self.timeSeries is not None 5141 ): 5142 return True 5143 else: 5144 return False
5145 - def exportLiteral(self, outfile, level, name_='TimeSeriesResponseType'):
5146 level += 1 5147 self.exportLiteralAttributes(outfile, level, [], name_) 5148 if self.hasContent_(): 5149 self.exportLiteralChildren(outfile, level, name_)
5150 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5151 pass
5152 - def exportLiteralChildren(self, outfile, level, name_):
5153 if self.queryInfo is not None: 5154 showIndent(outfile, level) 5155 outfile.write('queryInfo=model_.QueryInfoType(\n') 5156 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo') 5157 showIndent(outfile, level) 5158 outfile.write('),\n') 5159 if self.timeSeries is not None: 5160 showIndent(outfile, level) 5161 outfile.write('timeSeries=model_.TimeSeriesType(\n') 5162 self.timeSeries.exportLiteral(outfile, level, name_='timeSeries') 5163 showIndent(outfile, level) 5164 outfile.write('),\n')
5165 - def build(self, node):
5166 self.buildAttributes(node, node.attrib, []) 5167 for child in node: 5168 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5169 self.buildChildren(child, nodeName_)
5170 - def buildAttributes(self, node, attrs, already_processed):
5171 pass
5172 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5173 if nodeName_ == 'queryInfo': 5174 obj_ = QueryInfoType.factory() 5175 obj_.build(child_) 5176 self.set_queryInfo(obj_) 5177 elif nodeName_ == 'timeSeries': 5178 obj_ = TimeSeriesType.factory() 5179 obj_.build(child_) 5180 self.set_timeSeries(obj_)
5181 # end class TimeSeriesResponseType 5182 5183
5184 -class SiteInfoResponseType(GeneratedsSuper):
5185 """A sitesResponse contains a list of zero or more site elements. The 5186 siteInfo element contains the basic site information, siteName, 5187 location, siteCodes, properties. The seriesCatalog contains the 5188 list of observation series conducted at a site. A site element 5189 can have two parts: siteInfo, and one or more seriesCatalogs. 5190 Rules: GetSites(site[]) or GetSites(null), return no 5191 seriesCatalogs elements GetSiteInfo(site) return all information 5192 about a site, including the seriesCatalog.""" 5193 subclass = None 5194 superclass = None
5195 - def __init__(self, queryInfo=None, site=None):
5196 self.queryInfo = queryInfo 5197 if site is None: 5198 self.site = [] 5199 else: 5200 self.site = site
5201 - def factory(*args_, **kwargs_):
5202 if SiteInfoResponseType.subclass: 5203 return SiteInfoResponseType.subclass(*args_, **kwargs_) 5204 else: 5205 return SiteInfoResponseType(*args_, **kwargs_)
5206 factory = staticmethod(factory)
5207 - def get_queryInfo(self): return self.queryInfo
5208 - def set_queryInfo(self, queryInfo): self.queryInfo = queryInfo
5209 - def get_site(self): return self.site
5210 - def set_site(self, site): self.site = site
5211 - def add_site(self, value): self.site.append(value)
5212 - def insert_site(self, index, value): self.site[index] = value
5213 - def export(self, outfile, level, namespace_='', name_='SiteInfoResponseType', namespacedef_=''):
5214 showIndent(outfile, level) 5215 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5216 self.exportAttributes(outfile, level, [], namespace_, name_='SiteInfoResponseType') 5217 if self.hasContent_(): 5218 outfile.write('>\n') 5219 self.exportChildren(outfile, level + 1, namespace_, name_) 5220 showIndent(outfile, level) 5221 outfile.write('</%s%s>\n' % (namespace_, name_)) 5222 else: 5223 outfile.write('/>\n')
5224 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SiteInfoResponseType'):
5225 pass
5226 - def exportChildren(self, outfile, level, namespace_='', name_='SiteInfoResponseType'):
5227 if self.queryInfo: 5228 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', ) 5229 for site_ in self.site: 5230 site_.export(outfile, level, namespace_, name_='site')
5231 - def hasContent_(self):
5232 if ( 5233 self.queryInfo is not None or 5234 self.site 5235 ): 5236 return True 5237 else: 5238 return False
5239 - def exportLiteral(self, outfile, level, name_='SiteInfoResponseType'):
5240 level += 1 5241 self.exportLiteralAttributes(outfile, level, [], name_) 5242 if self.hasContent_(): 5243 self.exportLiteralChildren(outfile, level, name_)
5244 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5245 pass
5246 - def exportLiteralChildren(self, outfile, level, name_):
5247 if self.queryInfo is not None: 5248 showIndent(outfile, level) 5249 outfile.write('queryInfo=model_.QueryInfoType(\n') 5250 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo') 5251 showIndent(outfile, level) 5252 outfile.write('),\n') 5253 showIndent(outfile, level) 5254 outfile.write('site=[\n') 5255 level += 1 5256 for site_ in self.site: 5257 showIndent(outfile, level) 5258 outfile.write('model_.site(\n') 5259 site_.exportLiteral(outfile, level) 5260 showIndent(outfile, level) 5261 outfile.write('),\n') 5262 level -= 1 5263 showIndent(outfile, level) 5264 outfile.write('],\n')
5265 - def build(self, node):
5266 self.buildAttributes(node, node.attrib, []) 5267 for child in node: 5268 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5269 self.buildChildren(child, nodeName_)
5270 - def buildAttributes(self, node, attrs, already_processed):
5271 pass
5272 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5273 if nodeName_ == 'queryInfo': 5274 obj_ = QueryInfoType.factory() 5275 obj_.build(child_) 5276 self.set_queryInfo(obj_) 5277 elif nodeName_ == 'site': 5278 obj_ = site.factory() 5279 obj_.build(child_) 5280 self.site.append(obj_)
5281 # end class SiteInfoResponseType 5282 5283
5284 -class site(GeneratedsSuper):
5285 """A site element can have two parts: siteInfo, and one or more 5286 seriesCatalogs. The siteInfo element contains the basic site 5287 information, siteName, location, siteCodes, properties. The 5288 seriesCatalog contains the list of observation series conducted 5289 at a site. Rules: GetSites(site[]) or GetSites(null), return no 5290 seriesCatalogs elements GetSiteInfo(site) return all information 5291 about a site, including the seriesCatalog.""" 5292 subclass = None 5293 superclass = None
5294 - def __init__(self, siteInfo=None, seriesCatalog=None, extension=None):
5295 self.siteInfo = siteInfo 5296 if seriesCatalog is None: 5297 self.seriesCatalog = [] 5298 else: 5299 self.seriesCatalog = seriesCatalog 5300 self.extension = extension
5301 - def factory(*args_, **kwargs_):
5302 if site.subclass: 5303 return site.subclass(*args_, **kwargs_) 5304 else: 5305 return site(*args_, **kwargs_)
5306 factory = staticmethod(factory)
5307 - def get_siteInfo(self): return self.siteInfo
5308 - def set_siteInfo(self, siteInfo): self.siteInfo = siteInfo
5309 - def get_seriesCatalog(self): return self.seriesCatalog
5310 - def set_seriesCatalog(self, seriesCatalog): self.seriesCatalog = seriesCatalog
5311 - def add_seriesCatalog(self, value): self.seriesCatalog.append(value)
5312 - def insert_seriesCatalog(self, index, value): self.seriesCatalog[index] = value
5313 - def get_extension(self): return self.extension
5314 - def set_extension(self, extension): self.extension = extension
5315 - def export(self, outfile, level, namespace_='', name_='site', namespacedef_=''):
5316 showIndent(outfile, level) 5317 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5318 self.exportAttributes(outfile, level, [], namespace_, name_='site') 5319 if self.hasContent_(): 5320 outfile.write('>\n') 5321 self.exportChildren(outfile, level + 1, namespace_, name_) 5322 showIndent(outfile, level) 5323 outfile.write('</%s%s>\n' % (namespace_, name_)) 5324 else: 5325 outfile.write('/>\n')
5326 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='site'):
5327 pass
5328 - def exportChildren(self, outfile, level, namespace_='', name_='site'):
5329 if self.siteInfo: 5330 self.siteInfo.export(outfile, level, namespace_, name_='siteInfo', ) 5331 for seriesCatalog_ in self.seriesCatalog: 5332 seriesCatalog_.export(outfile, level, namespace_, name_='seriesCatalog') 5333 if self.extension is not None: 5334 showIndent(outfile, level) 5335 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
5336 - def hasContent_(self):
5337 if ( 5338 self.siteInfo is not None or 5339 self.seriesCatalog or 5340 self.extension is not None 5341 ): 5342 return True 5343 else: 5344 return False
5345 - def exportLiteral(self, outfile, level, name_='site'):
5346 level += 1 5347 self.exportLiteralAttributes(outfile, level, [], name_) 5348 if self.hasContent_(): 5349 self.exportLiteralChildren(outfile, level, name_)
5350 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5351 pass
5352 - def exportLiteralChildren(self, outfile, level, name_):
5353 if self.siteInfo is not None: 5354 showIndent(outfile, level) 5355 outfile.write('siteInfo=model_.SiteInfoType(\n') 5356 self.siteInfo.exportLiteral(outfile, level, name_='siteInfo') 5357 showIndent(outfile, level) 5358 outfile.write('),\n') 5359 showIndent(outfile, level) 5360 outfile.write('seriesCatalog=[\n') 5361 level += 1 5362 for seriesCatalog_ in self.seriesCatalog: 5363 showIndent(outfile, level) 5364 outfile.write('model_.seriesCatalogType(\n') 5365 seriesCatalog_.exportLiteral(outfile, level, name_='seriesCatalogType') 5366 showIndent(outfile, level) 5367 outfile.write('),\n') 5368 level -= 1 5369 showIndent(outfile, level) 5370 outfile.write('],\n') 5371 if self.extension is not None: 5372 showIndent(outfile, level) 5373 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
5374 - def build(self, node):
5375 self.buildAttributes(node, node.attrib, []) 5376 for child in node: 5377 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5378 self.buildChildren(child, nodeName_)
5379 - def buildAttributes(self, node, attrs, already_processed):
5380 pass
5381 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5382 if nodeName_ == 'siteInfo': 5383 obj_ = SiteInfoType.factory() 5384 obj_.build(child_) 5385 self.set_siteInfo(obj_) 5386 elif nodeName_ == 'seriesCatalog': 5387 obj_ = seriesCatalogType.factory() 5388 obj_.build(child_) 5389 self.seriesCatalog.append(obj_) 5390 elif nodeName_ == 'extension': 5391 extension_ = child_.text 5392 self.extension = extension_
5393 # end class site 5394 5395
5396 -class qualityControlLevel(GeneratedsSuper):
5397 """quality control levels that are used for versioning data within the 5398 database. Code used to identify the level of quality control to 5399 which data values have been subjected.""" 5400 subclass = None 5401 superclass = None
5402 - def __init__(self, metadataDateTime=None, network=None, vocabulary=None, qualityControlLevelCode=None, oid=None, default=None, qualityControlLevelID=None):
5403 self.metadataDateTime = _cast(None, metadataDateTime) 5404 self.network = _cast(None, network) 5405 self.vocabulary = _cast(None, vocabulary) 5406 self.qualityControlLevelCode = _cast(None, qualityControlLevelCode) 5407 self.oid = _cast(None, oid) 5408 self.default = _cast(bool, default) 5409 self.qualityControlLevelID = qualityControlLevelID
5410 - def factory(*args_, **kwargs_):
5411 if qualityControlLevel.subclass: 5412 return qualityControlLevel.subclass(*args_, **kwargs_) 5413 else: 5414 return qualityControlLevel(*args_, **kwargs_)
5415 factory = staticmethod(factory)
5416 - def get_qualityControlLevelID(self): return self.qualityControlLevelID
5417 - def set_qualityControlLevelID(self, qualityControlLevelID): self.qualityControlLevelID = qualityControlLevelID
5418 - def get_metadataDateTime(self): return self.metadataDateTime
5419 - def set_metadataDateTime(self, metadataDateTime): self.metadataDateTime = metadataDateTime
5420 - def get_network(self): return self.network
5421 - def set_network(self, network): self.network = network
5422 - def get_vocabulary(self): return self.vocabulary
5423 - def set_vocabulary(self, vocabulary): self.vocabulary = vocabulary
5424 - def get_qualityControlLevelCode(self): return self.qualityControlLevelCode
5425 - def set_qualityControlLevelCode(self, qualityControlLevelCode): self.qualityControlLevelCode = qualityControlLevelCode
5426 - def get_oid(self): return self.oid
5427 - def set_oid(self, oid): self.oid = oid
5428 - def get_default(self): return self.default
5429 - def set_default(self, default): self.default = default
5430 - def export(self, outfile, level, namespace_='', name_='qualityControlLevel', namespacedef_=''):
5431 showIndent(outfile, level) 5432 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5433 self.exportAttributes(outfile, level, [], namespace_, name_='qualityControlLevel') 5434 if self.hasContent_(): 5435 outfile.write('>\n') 5436 self.exportChildren(outfile, level + 1, namespace_, name_) 5437 showIndent(outfile, level) 5438 outfile.write('</%s%s>\n' % (namespace_, name_)) 5439 else: 5440 outfile.write('/>\n')
5441 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='qualityControlLevel'):
5442 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 5443 already_processed.append('metadataDateTime') 5444 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), )) 5445 if self.network is not None and 'network' not in already_processed: 5446 already_processed.append('network') 5447 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), )) 5448 if self.vocabulary is not None and 'vocabulary' not in already_processed: 5449 already_processed.append('vocabulary') 5450 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), )) 5451 if self.qualityControlLevelCode is not None and 'qualityControlLevelCode' not in already_processed: 5452 already_processed.append('qualityControlLevelCode') 5453 outfile.write(' qualityControlLevelCode=%s' % (self.gds_format_string(quote_attrib(self.qualityControlLevelCode).encode(ExternalEncoding), input_name='qualityControlLevelCode'), )) 5454 if self.oid is not None and 'oid' not in already_processed: 5455 already_processed.append('oid') 5456 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), )) 5457 if self.default is not None and 'default' not in already_processed: 5458 already_processed.append('default') 5459 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default'))
5460 - def exportChildren(self, outfile, level, namespace_='', name_='qualityControlLevel'):
5461 if self.qualityControlLevelID is not None: 5462 showIndent(outfile, level) 5463 outfile.write('<%squalityControlLevelID>%s</%squalityControlLevelID>\n' % (namespace_, self.gds_format_string(quote_xml(self.qualityControlLevelID).encode(ExternalEncoding), input_name='qualityControlLevelID'), namespace_))
5464 - def hasContent_(self):
5465 if ( 5466 self.qualityControlLevelID is not None 5467 ): 5468 return True 5469 else: 5470 return False
5471 - def exportLiteral(self, outfile, level, name_='qualityControlLevel'):
5472 level += 1 5473 self.exportLiteralAttributes(outfile, level, [], name_) 5474 if self.hasContent_(): 5475 self.exportLiteralChildren(outfile, level, name_)
5476 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5477 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 5478 already_processed.append('metadataDateTime') 5479 showIndent(outfile, level) 5480 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,)) 5481 if self.network is not None and 'network' not in already_processed: 5482 already_processed.append('network') 5483 showIndent(outfile, level) 5484 outfile.write('network = "%s",\n' % (self.network,)) 5485 if self.vocabulary is not None and 'vocabulary' not in already_processed: 5486 already_processed.append('vocabulary') 5487 showIndent(outfile, level) 5488 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,)) 5489 if self.qualityControlLevelCode is not None and 'qualityControlLevelCode' not in already_processed: 5490 already_processed.append('qualityControlLevelCode') 5491 showIndent(outfile, level) 5492 outfile.write('qualityControlLevelCode = "%s",\n' % (self.qualityControlLevelCode,)) 5493 if self.oid is not None and 'oid' not in already_processed: 5494 already_processed.append('oid') 5495 showIndent(outfile, level) 5496 outfile.write('oid = "%s",\n' % (self.oid,)) 5497 if self.default is not None and 'default' not in already_processed: 5498 already_processed.append('default') 5499 showIndent(outfile, level) 5500 outfile.write('default = %s,\n' % (self.default,))
5501 - def exportLiteralChildren(self, outfile, level, name_):
5502 if self.qualityControlLevelID is not None: 5503 showIndent(outfile, level) 5504 outfile.write('qualityControlLevelID=%s,\n' % quote_python(self.qualityControlLevelID).encode(ExternalEncoding))
5505 - def build(self, node):
5506 self.buildAttributes(node, node.attrib, []) 5507 for child in node: 5508 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5509 self.buildChildren(child, nodeName_)
5510 - def buildAttributes(self, node, attrs, already_processed):
5511 value = attrs.get('metadataDateTime') 5512 if value is not None and 'metadataDateTime' not in already_processed: 5513 already_processed.append('metadataDateTime') 5514 self.metadataDateTime = value 5515 value = attrs.get('network') 5516 if value is not None and 'network' not in already_processed: 5517 already_processed.append('network') 5518 self.network = value 5519 value = attrs.get('vocabulary') 5520 if value is not None and 'vocabulary' not in already_processed: 5521 already_processed.append('vocabulary') 5522 self.vocabulary = value 5523 value = attrs.get('qualityControlLevelCode') 5524 if value is not None and 'qualityControlLevelCode' not in already_processed: 5525 already_processed.append('qualityControlLevelCode') 5526 self.qualityControlLevelCode = value 5527 value = attrs.get('oid') 5528 if value is not None and 'oid' not in already_processed: 5529 already_processed.append('oid') 5530 self.oid = value 5531 value = attrs.get('default') 5532 if value is not None and 'default' not in already_processed: 5533 already_processed.append('default') 5534 if value in ('true', '1'): 5535 self.default = True 5536 elif value in ('false', '0'): 5537 self.default = False 5538 else: 5539 raise_parse_error(node, 'Bad boolean attribute')
5540 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5541 if nodeName_ == 'qualityControlLevelID': 5542 qualityControlLevelID_ = child_.text 5543 self.qualityControlLevelID = qualityControlLevelID_
5544 # end class qualityControlLevel 5545 5546
5547 -class QualityControlLevelType(GeneratedsSuper):
5548 """Value is the text Code used to identify the level of quality control 5549 to which data values have been subjected.Integer identifier that 5550 indicates the level of quality control that the data values have 5551 been subjected to.""" 5552 subclass = None 5553 superclass = None
5554 - def __init__(self, qualityControlLevelID=None, valueOf_=None):
5555 self.qualityControlLevelID = _cast(int, qualityControlLevelID) 5556 self.valueOf_ = valueOf_
5557 - def factory(*args_, **kwargs_):
5558 if QualityControlLevelType.subclass: 5559 return QualityControlLevelType.subclass(*args_, **kwargs_) 5560 else: 5561 return QualityControlLevelType(*args_, **kwargs_)
5562 factory = staticmethod(factory)
5563 - def get_qualityControlLevelID(self): return self.qualityControlLevelID
5564 - def set_qualityControlLevelID(self, qualityControlLevelID): self.qualityControlLevelID = qualityControlLevelID
5565 - def get_valueOf_(self): return self.valueOf_
5566 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
5567 - def export(self, outfile, level, namespace_='', name_='QualityControlLevelType', namespacedef_=''):
5568 showIndent(outfile, level) 5569 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5570 self.exportAttributes(outfile, level, [], namespace_, name_='QualityControlLevelType') 5571 if self.hasContent_(): 5572 outfile.write('>') 5573 outfile.write(self.valueOf_) 5574 self.exportChildren(outfile, level + 1, namespace_, name_) 5575 outfile.write('</%s%s>\n' % (namespace_, name_)) 5576 else: 5577 outfile.write('/>\n')
5578 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QualityControlLevelType'):
5579 if self.qualityControlLevelID is not None and 'qualityControlLevelID' not in already_processed: 5580 already_processed.append('qualityControlLevelID') 5581 outfile.write(' qualityControlLevelID="%s"' % self.gds_format_integer(self.qualityControlLevelID, input_name='qualityControlLevelID'))
5582 - def exportChildren(self, outfile, level, namespace_='', name_='QualityControlLevelType'):
5583 pass
5584 - def hasContent_(self):
5585 if ( 5586 self.valueOf_ 5587 ): 5588 return True 5589 else: 5590 return False
5591 - def exportLiteral(self, outfile, level, name_='QualityControlLevelType'):
5592 level += 1 5593 self.exportLiteralAttributes(outfile, level, [], name_) 5594 if self.hasContent_(): 5595 self.exportLiteralChildren(outfile, level, name_) 5596 showIndent(outfile, level) 5597 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
5598 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5599 if self.qualityControlLevelID is not None and 'qualityControlLevelID' not in already_processed: 5600 already_processed.append('qualityControlLevelID') 5601 showIndent(outfile, level) 5602 outfile.write('qualityControlLevelID = %d,\n' % (self.qualityControlLevelID,))
5603 - def exportLiteralChildren(self, outfile, level, name_):
5604 pass
5605 - def build(self, node):
5606 self.buildAttributes(node, node.attrib, []) 5607 self.valueOf_ = get_all_text_(node) 5608 for child in node: 5609 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5610 self.buildChildren(child, nodeName_)
5611 - def buildAttributes(self, node, attrs, already_processed):
5612 value = attrs.get('qualityControlLevelID') 5613 if value is not None and 'qualityControlLevelID' not in already_processed: 5614 already_processed.append('qualityControlLevelID') 5615 try: 5616 self.qualityControlLevelID = int(value) 5617 except ValueError, exp: 5618 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5619 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5620 pass
5621 # end class QualityControlLevelType 5622 5623
5624 -class UnitsType(GeneratedsSuper):
5625 subclass = None 5626 superclass = None
5627 - def __init__(self, UnitID=None, UnitName=None, UnitDescription=None, UnitType=None, UnitAbbreviation=None):
5628 self.UnitID = _cast(int, UnitID) 5629 self.UnitName = UnitName 5630 self.UnitDescription = UnitDescription 5631 self.UnitType = UnitType 5632 self.UnitAbbreviation = UnitAbbreviation
5633 - def factory(*args_, **kwargs_):
5634 if UnitsType.subclass: 5635 return UnitsType.subclass(*args_, **kwargs_) 5636 else: 5637 return UnitsType(*args_, **kwargs_)
5638 factory = staticmethod(factory)
5639 - def get_UnitName(self): return self.UnitName
5640 - def set_UnitName(self, UnitName): self.UnitName = UnitName
5641 - def get_UnitDescription(self): return self.UnitDescription
5642 - def set_UnitDescription(self, UnitDescription): self.UnitDescription = UnitDescription
5643 - def get_UnitType(self): return self.UnitType
5644 - def set_UnitType(self, UnitType): self.UnitType = UnitType
5645 - def validate_UnitType(self, value):
5646 # validate type UnitType 5647 pass
5648 - def get_UnitAbbreviation(self): return self.UnitAbbreviation
5649 - def set_UnitAbbreviation(self, UnitAbbreviation): self.UnitAbbreviation = UnitAbbreviation
5650 - def get_UnitID(self): return self.UnitID
5651 - def set_UnitID(self, UnitID): self.UnitID = UnitID
5652 - def export(self, outfile, level, namespace_='', name_='UnitsType', namespacedef_=''):
5653 showIndent(outfile, level) 5654 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5655 self.exportAttributes(outfile, level, [], namespace_, name_='UnitsType') 5656 if self.hasContent_(): 5657 outfile.write('>\n') 5658 self.exportChildren(outfile, level + 1, namespace_, name_) 5659 showIndent(outfile, level) 5660 outfile.write('</%s%s>\n' % (namespace_, name_)) 5661 else: 5662 outfile.write('/>\n')
5663 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UnitsType'):
5664 if self.UnitID is not None and 'UnitID' not in already_processed: 5665 already_processed.append('UnitID') 5666 outfile.write(' UnitID="%s"' % self.gds_format_integer(self.UnitID, input_name='UnitID'))
5667 - def exportChildren(self, outfile, level, namespace_='', name_='UnitsType'):
5668 if self.UnitName is not None: 5669 showIndent(outfile, level) 5670 outfile.write('<%sUnitName>%s</%sUnitName>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitName).encode(ExternalEncoding), input_name='UnitName'), namespace_)) 5671 if self.UnitDescription is not None: 5672 showIndent(outfile, level) 5673 outfile.write('<%sUnitDescription>%s</%sUnitDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitDescription).encode(ExternalEncoding), input_name='UnitDescription'), namespace_)) 5674 if self.UnitType is not None: 5675 showIndent(outfile, level) 5676 outfile.write('<%sUnitType>%s</%sUnitType>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitType).encode(ExternalEncoding), input_name='UnitType'), namespace_)) 5677 if self.UnitAbbreviation is not None: 5678 showIndent(outfile, level) 5679 outfile.write('<%sUnitAbbreviation>%s</%sUnitAbbreviation>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitAbbreviation).encode(ExternalEncoding), input_name='UnitAbbreviation'), namespace_))
5680 - def hasContent_(self):
5681 if ( 5682 self.UnitName is not None or 5683 self.UnitDescription is not None or 5684 self.UnitType is not None or 5685 self.UnitAbbreviation is not None 5686 ): 5687 return True 5688 else: 5689 return False
5690 - def exportLiteral(self, outfile, level, name_='UnitsType'):
5691 level += 1 5692 self.exportLiteralAttributes(outfile, level, [], name_) 5693 if self.hasContent_(): 5694 self.exportLiteralChildren(outfile, level, name_)
5695 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5696 if self.UnitID is not None and 'UnitID' not in already_processed: 5697 already_processed.append('UnitID') 5698 showIndent(outfile, level) 5699 outfile.write('UnitID = %d,\n' % (self.UnitID,))
5700 - def exportLiteralChildren(self, outfile, level, name_):
5701 if self.UnitName is not None: 5702 showIndent(outfile, level) 5703 outfile.write('UnitName=%s,\n' % quote_python(self.UnitName).encode(ExternalEncoding)) 5704 if self.UnitDescription is not None: 5705 showIndent(outfile, level) 5706 outfile.write('UnitDescription=%s,\n' % quote_python(self.UnitDescription).encode(ExternalEncoding)) 5707 if self.UnitType is not None: 5708 showIndent(outfile, level) 5709 outfile.write('UnitType=%s,\n' % quote_python(self.UnitType).encode(ExternalEncoding)) 5710 if self.UnitAbbreviation is not None: 5711 showIndent(outfile, level) 5712 outfile.write('UnitAbbreviation=%s,\n' % quote_python(self.UnitAbbreviation).encode(ExternalEncoding))
5713 - def build(self, node):
5714 self.buildAttributes(node, node.attrib, []) 5715 for child in node: 5716 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5717 self.buildChildren(child, nodeName_)
5718 - def buildAttributes(self, node, attrs, already_processed):
5719 value = attrs.get('UnitID') 5720 if value is not None and 'UnitID' not in already_processed: 5721 already_processed.append('UnitID') 5722 try: 5723 self.UnitID = int(value) 5724 except ValueError, exp: 5725 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5726 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5727 if nodeName_ == 'UnitName': 5728 UnitName_ = child_.text 5729 self.UnitName = UnitName_ 5730 elif nodeName_ == 'UnitDescription': 5731 UnitDescription_ = child_.text 5732 self.UnitDescription = UnitDescription_ 5733 elif nodeName_ == 'UnitType': 5734 UnitType_ = child_.text 5735 self.UnitType = UnitType_ 5736 self.validate_UnitType(self.UnitType) # validate type UnitType 5737 elif nodeName_ == 'UnitAbbreviation': 5738 UnitAbbreviation_ = child_.text 5739 self.UnitAbbreviation = UnitAbbreviation_
5740 # end class UnitsType 5741 5742
5743 -class MethodType(GeneratedsSuper):
5744 """Method used to collect the data and any additional information about 5745 the method. @methodId is the link to value/@method As per 5746 communication from the ODM designers, multiple instruments 5747 observing the same variable, should be different methods. 5748 Methods should describe the manner in which the observation was 5749 collected (i.e., collected manually, or collected using an 5750 automated sampler) or measured (i.e., measured using a 5751 temperature sensor or measured using a turbidity sensor). 5752 Details about the specific sensor models and manufacturers can 5753 be included in the MethodDescription""" 5754 subclass = None 5755 superclass = None
5756 - def __init__(self, methodID=None, MethodDescription=None, MethodLink=None):
5757 self.methodID = _cast(int, methodID) 5758 self.MethodDescription = MethodDescription 5759 self.MethodLink = MethodLink
5760 - def factory(*args_, **kwargs_):
5761 if MethodType.subclass: 5762 return MethodType.subclass(*args_, **kwargs_) 5763 else: 5764 return MethodType(*args_, **kwargs_)
5765 factory = staticmethod(factory)
5766 - def get_MethodDescription(self): return self.MethodDescription
5767 - def set_MethodDescription(self, MethodDescription): self.MethodDescription = MethodDescription
5770 - def get_methodID(self): return self.methodID
5771 - def set_methodID(self, methodID): self.methodID = methodID
5772 - def export(self, outfile, level, namespace_='', name_='MethodType', namespacedef_=''):
5773 showIndent(outfile, level) 5774 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5775 self.exportAttributes(outfile, level, [], namespace_, name_='MethodType') 5776 if self.hasContent_(): 5777 outfile.write('>\n') 5778 self.exportChildren(outfile, level + 1, namespace_, name_) 5779 showIndent(outfile, level) 5780 outfile.write('</%s%s>\n' % (namespace_, name_)) 5781 else: 5782 outfile.write('/>\n')
5783 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MethodType'):
5784 if self.methodID is not None and 'methodID' not in already_processed: 5785 already_processed.append('methodID') 5786 outfile.write(' methodID="%s"' % self.gds_format_integer(self.methodID, input_name='methodID'))
5787 - def exportChildren(self, outfile, level, namespace_='', name_='MethodType'):
5788 if self.MethodDescription is not None: 5789 showIndent(outfile, level) 5790 outfile.write('<%sMethodDescription>%s</%sMethodDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.MethodDescription).encode(ExternalEncoding), input_name='MethodDescription'), namespace_)) 5791 if self.MethodLink is not None: 5792 showIndent(outfile, level) 5793 outfile.write('<%sMethodLink>%s</%sMethodLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.MethodLink).encode(ExternalEncoding), input_name='MethodLink'), namespace_))
5794 - def hasContent_(self):
5795 if ( 5796 self.MethodDescription is not None or 5797 self.MethodLink is not None 5798 ): 5799 return True 5800 else: 5801 return False
5802 - def exportLiteral(self, outfile, level, name_='MethodType'):
5803 level += 1 5804 self.exportLiteralAttributes(outfile, level, [], name_) 5805 if self.hasContent_(): 5806 self.exportLiteralChildren(outfile, level, name_)
5807 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5808 if self.methodID is not None and 'methodID' not in already_processed: 5809 already_processed.append('methodID') 5810 showIndent(outfile, level) 5811 outfile.write('methodID = %d,\n' % (self.methodID,))
5812 - def exportLiteralChildren(self, outfile, level, name_):
5813 if self.MethodDescription is not None: 5814 showIndent(outfile, level) 5815 outfile.write('MethodDescription=%s,\n' % quote_python(self.MethodDescription).encode(ExternalEncoding)) 5816 if self.MethodLink is not None: 5817 showIndent(outfile, level) 5818 outfile.write('MethodLink=%s,\n' % quote_python(self.MethodLink).encode(ExternalEncoding))
5819 - def build(self, node):
5820 self.buildAttributes(node, node.attrib, []) 5821 for child in node: 5822 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5823 self.buildChildren(child, nodeName_)
5824 - def buildAttributes(self, node, attrs, already_processed):
5825 value = attrs.get('methodID') 5826 if value is not None and 'methodID' not in already_processed: 5827 already_processed.append('methodID') 5828 try: 5829 self.methodID = int(value) 5830 except ValueError, exp: 5831 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5832 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5833 if nodeName_ == 'MethodDescription': 5834 MethodDescription_ = child_.text 5835 self.MethodDescription = MethodDescription_ 5836 elif nodeName_ == 'MethodLink': 5837 MethodLink_ = child_.text 5838 self.MethodLink = MethodLink_
5839 # end class MethodType 5840 5841
5842 -class SampleType(GeneratedsSuper):
5843 """information about physical samples analyzed in a laboratory. 5844 @sampleID is the link to the datavalues/@sampleID LabSampleCode 5845 is the sample code. In WaterML 1.1 this will be the link to the 5846 dataValue SampleType describes the the sample type LabMethod is 5847 a LabMethodType containing infomration about lab methods""" 5848 subclass = None 5849 superclass = None
5850 - def __init__(self, sampleID=None, labSampleCode=None, SampleType=None, LabMethod=None):
5851 self.sampleID = _cast(int, sampleID) 5852 self.labSampleCode = labSampleCode 5853 self.SampleType = SampleType 5854 self.LabMethod = LabMethod
5855 - def factory(*args_, **kwargs_):
5856 if SampleType.subclass: 5857 return SampleType.subclass(*args_, **kwargs_) 5858 else: 5859 return SampleType(*args_, **kwargs_)
5860 factory = staticmethod(factory)
5861 - def get_labSampleCode(self): return self.labSampleCode
5862 - def set_labSampleCode(self, labSampleCode): self.labSampleCode = labSampleCode
5863 - def get_SampleType(self): return self.SampleType
5864 - def set_SampleType(self, SampleType): self.SampleType = SampleType
5865 - def validate_SampleType(self, value):
5866 # validate type SampleType 5867 pass
5868 - def get_LabMethod(self): return self.LabMethod
5869 - def set_LabMethod(self, LabMethod): self.LabMethod = LabMethod
5870 - def get_sampleID(self): return self.sampleID
5871 - def set_sampleID(self, sampleID): self.sampleID = sampleID
5872 - def export(self, outfile, level, namespace_='', name_='SampleType', namespacedef_=''):
5873 showIndent(outfile, level) 5874 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5875 self.exportAttributes(outfile, level, [], namespace_, name_='SampleType') 5876 if self.hasContent_(): 5877 outfile.write('>\n') 5878 self.exportChildren(outfile, level + 1, namespace_, name_) 5879 showIndent(outfile, level) 5880 outfile.write('</%s%s>\n' % (namespace_, name_)) 5881 else: 5882 outfile.write('/>\n')
5883 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SampleType'):
5884 if self.sampleID is not None and 'sampleID' not in already_processed: 5885 already_processed.append('sampleID') 5886 outfile.write(' sampleID="%s"' % self.gds_format_integer(self.sampleID, input_name='sampleID'))
5887 - def exportChildren(self, outfile, level, namespace_='', name_='SampleType'):
5888 if self.labSampleCode is not None: 5889 showIndent(outfile, level) 5890 outfile.write('<%slabSampleCode>%s</%slabSampleCode>\n' % (namespace_, self.gds_format_string(quote_xml(self.labSampleCode).encode(ExternalEncoding), input_name='labSampleCode'), namespace_)) 5891 if self.SampleType is not None: 5892 showIndent(outfile, level) 5893 outfile.write('<%sSampleType>%s</%sSampleType>\n' % (namespace_, self.gds_format_string(quote_xml(self.SampleType).encode(ExternalEncoding), input_name='SampleType'), namespace_)) 5894 if self.LabMethod: 5895 self.LabMethod.export(outfile, level, namespace_, name_='LabMethod')
5896 - def hasContent_(self):
5897 if ( 5898 self.labSampleCode is not None or 5899 self.SampleType is not None or 5900 self.LabMethod is not None 5901 ): 5902 return True 5903 else: 5904 return False
5905 - def exportLiteral(self, outfile, level, name_='SampleType'):
5906 level += 1 5907 self.exportLiteralAttributes(outfile, level, [], name_) 5908 if self.hasContent_(): 5909 self.exportLiteralChildren(outfile, level, name_)
5910 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5911 if self.sampleID is not None and 'sampleID' not in already_processed: 5912 already_processed.append('sampleID') 5913 showIndent(outfile, level) 5914 outfile.write('sampleID = %d,\n' % (self.sampleID,))
5915 - def exportLiteralChildren(self, outfile, level, name_):
5916 if self.labSampleCode is not None: 5917 showIndent(outfile, level) 5918 outfile.write('labSampleCode=%s,\n' % quote_python(self.labSampleCode).encode(ExternalEncoding)) 5919 if self.SampleType is not None: 5920 showIndent(outfile, level) 5921 outfile.write('SampleType=%s,\n' % quote_python(self.SampleType).encode(ExternalEncoding)) 5922 if self.LabMethod is not None: 5923 showIndent(outfile, level) 5924 outfile.write('LabMethod=model_.LabMethodType(\n') 5925 self.LabMethod.exportLiteral(outfile, level, name_='LabMethod') 5926 showIndent(outfile, level) 5927 outfile.write('),\n')
5928 - def build(self, node):
5929 self.buildAttributes(node, node.attrib, []) 5930 for child in node: 5931 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5932 self.buildChildren(child, nodeName_)
5933 - def buildAttributes(self, node, attrs, already_processed):
5934 value = attrs.get('sampleID') 5935 if value is not None and 'sampleID' not in already_processed: 5936 already_processed.append('sampleID') 5937 try: 5938 self.sampleID = int(value) 5939 except ValueError, exp: 5940 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5941 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5942 if nodeName_ == 'labSampleCode': 5943 labSampleCode_ = child_.text 5944 self.labSampleCode = labSampleCode_ 5945 elif nodeName_ == 'SampleType': 5946 SampleType_ = child_.text 5947 self.SampleType = SampleType_ 5948 self.validate_SampleType(self.SampleType) # validate type SampleType 5949 elif nodeName_ == 'LabMethod': 5950 obj_ = LabMethodType.factory() 5951 obj_.build(child_) 5952 self.set_LabMethod(obj_)
5953 # end class SampleType 5954 5955
5956 -class LabMethodType(GeneratedsSuper):
5957 """contains descriptions of the laboratory methods used to analyze 5958 physical samples for specific constituents.Unique integer 5959 identifier for each laboratory method. This is the key used by 5960 the Samples table to reference a laboratory method.""" 5961 subclass = None 5962 superclass = None
5963 - def __init__(self, labMethodID=None, labName=None, labOrganization=None, LabMethodName=None, labMethodDescription=None, labMethodLink=None):
5964 self.labMethodID = _cast(int, labMethodID) 5965 self.labName = labName 5966 self.labOrganization = labOrganization 5967 self.LabMethodName = LabMethodName 5968 self.labMethodDescription = labMethodDescription 5969 self.labMethodLink = labMethodLink
5970 - def factory(*args_, **kwargs_):
5971 if LabMethodType.subclass: 5972 return LabMethodType.subclass(*args_, **kwargs_) 5973 else: 5974 return LabMethodType(*args_, **kwargs_)
5975 factory = staticmethod(factory)
5976 - def get_labName(self): return self.labName
5977 - def set_labName(self, labName): self.labName = labName
5978 - def get_labOrganization(self): return self.labOrganization
5979 - def set_labOrganization(self, labOrganization): self.labOrganization = labOrganization
5980 - def get_LabMethodName(self): return self.LabMethodName
5981 - def set_LabMethodName(self, LabMethodName): self.LabMethodName = LabMethodName
5982 - def get_labMethodDescription(self): return self.labMethodDescription
5983 - def set_labMethodDescription(self, labMethodDescription): self.labMethodDescription = labMethodDescription
5986 - def get_labMethodID(self): return self.labMethodID
5987 - def set_labMethodID(self, labMethodID): self.labMethodID = labMethodID
5988 - def export(self, outfile, level, namespace_='', name_='LabMethodType', namespacedef_=''):
5989 showIndent(outfile, level) 5990 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5991 self.exportAttributes(outfile, level, [], namespace_, name_='LabMethodType') 5992 if self.hasContent_(): 5993 outfile.write('>\n') 5994 self.exportChildren(outfile, level + 1, namespace_, name_) 5995 showIndent(outfile, level) 5996 outfile.write('</%s%s>\n' % (namespace_, name_)) 5997 else: 5998 outfile.write('/>\n')
5999 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LabMethodType'):
6000 if self.labMethodID is not None and 'labMethodID' not in already_processed: 6001 already_processed.append('labMethodID') 6002 outfile.write(' labMethodID="%s"' % self.gds_format_integer(self.labMethodID, input_name='labMethodID'))
6003 - def exportChildren(self, outfile, level, namespace_='', name_='LabMethodType'):
6004 if self.labName is not None: 6005 showIndent(outfile, level) 6006 outfile.write('<%slabName>%s</%slabName>\n' % (namespace_, self.gds_format_string(quote_xml(self.labName).encode(ExternalEncoding), input_name='labName'), namespace_)) 6007 if self.labOrganization is not None: 6008 showIndent(outfile, level) 6009 outfile.write('<%slabOrganization>%s</%slabOrganization>\n' % (namespace_, self.gds_format_string(quote_xml(self.labOrganization).encode(ExternalEncoding), input_name='labOrganization'), namespace_)) 6010 if self.LabMethodName is not None: 6011 showIndent(outfile, level) 6012 outfile.write('<%sLabMethodName>%s</%sLabMethodName>\n' % (namespace_, self.gds_format_string(quote_xml(self.LabMethodName).encode(ExternalEncoding), input_name='LabMethodName'), namespace_)) 6013 if self.labMethodDescription is not None: 6014 showIndent(outfile, level) 6015 outfile.write('<%slabMethodDescription>%s</%slabMethodDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.labMethodDescription).encode(ExternalEncoding), input_name='labMethodDescription'), namespace_)) 6016 if self.labMethodLink is not None: 6017 showIndent(outfile, level) 6018 outfile.write('<%slabMethodLink>%s</%slabMethodLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.labMethodLink).encode(ExternalEncoding), input_name='labMethodLink'), namespace_))
6019 - def hasContent_(self):
6020 if ( 6021 self.labName is not None or 6022 self.labOrganization is not None or 6023 self.LabMethodName is not None or 6024 self.labMethodDescription is not None or 6025 self.labMethodLink is not None 6026 ): 6027 return True 6028 else: 6029 return False
6030 - def exportLiteral(self, outfile, level, name_='LabMethodType'):
6031 level += 1 6032 self.exportLiteralAttributes(outfile, level, [], name_) 6033 if self.hasContent_(): 6034 self.exportLiteralChildren(outfile, level, name_)
6035 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6036 if self.labMethodID is not None and 'labMethodID' not in already_processed: 6037 already_processed.append('labMethodID') 6038 showIndent(outfile, level) 6039 outfile.write('labMethodID = %d,\n' % (self.labMethodID,))
6040 - def exportLiteralChildren(self, outfile, level, name_):
6041 if self.labName is not None: 6042 showIndent(outfile, level) 6043 outfile.write('labName=%s,\n' % quote_python(self.labName).encode(ExternalEncoding)) 6044 if self.labOrganization is not None: 6045 showIndent(outfile, level) 6046 outfile.write('labOrganization=%s,\n' % quote_python(self.labOrganization).encode(ExternalEncoding)) 6047 if self.LabMethodName is not None: 6048 showIndent(outfile, level) 6049 outfile.write('LabMethodName=%s,\n' % quote_python(self.LabMethodName).encode(ExternalEncoding)) 6050 if self.labMethodDescription is not None: 6051 showIndent(outfile, level) 6052 outfile.write('labMethodDescription=%s,\n' % quote_python(self.labMethodDescription).encode(ExternalEncoding)) 6053 if self.labMethodLink is not None: 6054 showIndent(outfile, level) 6055 outfile.write('labMethodLink=%s,\n' % quote_python(self.labMethodLink).encode(ExternalEncoding))
6056 - def build(self, node):
6057 self.buildAttributes(node, node.attrib, []) 6058 for child in node: 6059 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6060 self.buildChildren(child, nodeName_)
6061 - def buildAttributes(self, node, attrs, already_processed):
6062 value = attrs.get('labMethodID') 6063 if value is not None and 'labMethodID' not in already_processed: 6064 already_processed.append('labMethodID') 6065 try: 6066 self.labMethodID = int(value) 6067 except ValueError, exp: 6068 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6069 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6070 if nodeName_ == 'labName': 6071 labName_ = child_.text 6072 self.labName = labName_ 6073 elif nodeName_ == 'labOrganization': 6074 labOrganization_ = child_.text 6075 self.labOrganization = labOrganization_ 6076 elif nodeName_ == 'LabMethodName': 6077 LabMethodName_ = child_.text 6078 self.LabMethodName = LabMethodName_ 6079 elif nodeName_ == 'labMethodDescription': 6080 labMethodDescription_ = child_.text 6081 self.labMethodDescription = labMethodDescription_ 6082 elif nodeName_ == 'labMethodLink': 6083 labMethodLink_ = child_.text 6084 self.labMethodLink = labMethodLink_
6085 # end class LabMethodType 6086 6087
6088 -class SourceType(GeneratedsSuper):
6089 """original sources of the data, providing information sufficient to 6090 retrieve and reconstruct the data value from the original data 6091 files if necessaryUnique integer identifier that identifies each 6092 data source. link to datavalues/@sourceID""" 6093 subclass = None 6094 superclass = None
6095 - def __init__(self, sourceID=None, Organization=None, SourceDescription=None, Metadata=None, ContactInformation=None, SourceLink=None):
6096 self.sourceID = _cast(int, sourceID) 6097 self.Organization = Organization 6098 self.SourceDescription = SourceDescription 6099 self.Metadata = Metadata 6100 self.ContactInformation = ContactInformation 6101 self.SourceLink = SourceLink
6102 - def factory(*args_, **kwargs_):
6103 if SourceType.subclass: 6104 return SourceType.subclass(*args_, **kwargs_) 6105 else: 6106 return SourceType(*args_, **kwargs_)
6107 factory = staticmethod(factory)
6108 - def get_Organization(self): return self.Organization
6109 - def set_Organization(self, Organization): self.Organization = Organization
6110 - def get_SourceDescription(self): return self.SourceDescription
6111 - def set_SourceDescription(self, SourceDescription): self.SourceDescription = SourceDescription
6112 - def get_Metadata(self): return self.Metadata
6113 - def set_Metadata(self, Metadata): self.Metadata = Metadata
6114 - def get_ContactInformation(self): return self.ContactInformation
6115 - def set_ContactInformation(self, ContactInformation): self.ContactInformation = ContactInformation
6118 - def get_sourceID(self): return self.sourceID
6119 - def set_sourceID(self, sourceID): self.sourceID = sourceID
6120 - def export(self, outfile, level, namespace_='', name_='SourceType', namespacedef_=''):
6121 showIndent(outfile, level) 6122 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6123 self.exportAttributes(outfile, level, [], namespace_, name_='SourceType') 6124 if self.hasContent_(): 6125 outfile.write('>\n') 6126 self.exportChildren(outfile, level + 1, namespace_, name_) 6127 showIndent(outfile, level) 6128 outfile.write('</%s%s>\n' % (namespace_, name_)) 6129 else: 6130 outfile.write('/>\n')
6131 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SourceType'):
6132 if self.sourceID is not None and 'sourceID' not in already_processed: 6133 already_processed.append('sourceID') 6134 outfile.write(' sourceID="%s"' % self.gds_format_integer(self.sourceID, input_name='sourceID'))
6135 - def exportChildren(self, outfile, level, namespace_='', name_='SourceType'):
6136 if self.Organization is not None: 6137 showIndent(outfile, level) 6138 outfile.write('<%sOrganization>%s</%sOrganization>\n' % (namespace_, self.gds_format_string(quote_xml(self.Organization).encode(ExternalEncoding), input_name='Organization'), namespace_)) 6139 if self.SourceDescription is not None: 6140 showIndent(outfile, level) 6141 outfile.write('<%sSourceDescription>%s</%sSourceDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.SourceDescription).encode(ExternalEncoding), input_name='SourceDescription'), namespace_)) 6142 if self.Metadata: 6143 self.Metadata.export(outfile, level, namespace_, name_='Metadata') 6144 if self.ContactInformation: 6145 self.ContactInformation.export(outfile, level, namespace_, name_='ContactInformation') 6146 if self.SourceLink is not None: 6147 showIndent(outfile, level) 6148 outfile.write('<%sSourceLink>%s</%sSourceLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.SourceLink).encode(ExternalEncoding), input_name='SourceLink'), namespace_))
6149 - def hasContent_(self):
6150 if ( 6151 self.Organization is not None or 6152 self.SourceDescription is not None or 6153 self.Metadata is not None or 6154 self.ContactInformation is not None or 6155 self.SourceLink is not None 6156 ): 6157 return True 6158 else: 6159 return False
6160 - def exportLiteral(self, outfile, level, name_='SourceType'):
6161 level += 1 6162 self.exportLiteralAttributes(outfile, level, [], name_) 6163 if self.hasContent_(): 6164 self.exportLiteralChildren(outfile, level, name_)
6165 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6166 if self.sourceID is not None and 'sourceID' not in already_processed: 6167 already_processed.append('sourceID') 6168 showIndent(outfile, level) 6169 outfile.write('sourceID = %d,\n' % (self.sourceID,))
6170 - def exportLiteralChildren(self, outfile, level, name_):
6171 if self.Organization is not None: 6172 showIndent(outfile, level) 6173 outfile.write('Organization=%s,\n' % quote_python(self.Organization).encode(ExternalEncoding)) 6174 if self.SourceDescription is not None: 6175 showIndent(outfile, level) 6176 outfile.write('SourceDescription=%s,\n' % quote_python(self.SourceDescription).encode(ExternalEncoding)) 6177 if self.Metadata is not None: 6178 showIndent(outfile, level) 6179 outfile.write('Metadata=model_.MetaDataType(\n') 6180 self.Metadata.exportLiteral(outfile, level, name_='Metadata') 6181 showIndent(outfile, level) 6182 outfile.write('),\n') 6183 if self.ContactInformation is not None: 6184 showIndent(outfile, level) 6185 outfile.write('ContactInformation=model_.ContactInformationType(\n') 6186 self.ContactInformation.exportLiteral(outfile, level, name_='ContactInformation') 6187 showIndent(outfile, level) 6188 outfile.write('),\n') 6189 if self.SourceLink is not None: 6190 showIndent(outfile, level) 6191 outfile.write('SourceLink=%s,\n' % quote_python(self.SourceLink).encode(ExternalEncoding))
6192 - def build(self, node):
6193 self.buildAttributes(node, node.attrib, []) 6194 for child in node: 6195 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6196 self.buildChildren(child, nodeName_)
6197 - def buildAttributes(self, node, attrs, already_processed):
6198 value = attrs.get('sourceID') 6199 if value is not None and 'sourceID' not in already_processed: 6200 already_processed.append('sourceID') 6201 try: 6202 self.sourceID = int(value) 6203 except ValueError, exp: 6204 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6205 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6206 if nodeName_ == 'Organization': 6207 Organization_ = child_.text 6208 self.Organization = Organization_ 6209 elif nodeName_ == 'SourceDescription': 6210 SourceDescription_ = child_.text 6211 self.SourceDescription = SourceDescription_ 6212 elif nodeName_ == 'Metadata': 6213 obj_ = MetaDataType.factory() 6214 obj_.build(child_) 6215 self.set_Metadata(obj_) 6216 elif nodeName_ == 'ContactInformation': 6217 obj_ = ContactInformationType.factory() 6218 obj_.build(child_) 6219 self.set_ContactInformation(obj_) 6220 elif nodeName_ == 'SourceLink': 6221 SourceLink_ = child_.text 6222 self.SourceLink = SourceLink_
6223 # end class SourceType 6224 6225
6226 -class ContactInformationType(GeneratedsSuper):
6227 """Contains information about a contact. A contact can be a person or 6228 an agency. The name of the contact is required. And address, 6229 email or phone is suggested. (in 1.1 one of these will be 6230 required.""" 6231 subclass = None 6232 superclass = None
6233 - def __init__(self, ContactName=None, TypeOfContact=None, Phone=None, Email=None, Address=None):
6234 self.ContactName = ContactName 6235 self.TypeOfContact = TypeOfContact 6236 self.Phone = Phone 6237 self.Email = Email 6238 self.Address = Address
6239 - def factory(*args_, **kwargs_):
6240 if ContactInformationType.subclass: 6241 return ContactInformationType.subclass(*args_, **kwargs_) 6242 else: 6243 return ContactInformationType(*args_, **kwargs_)
6244 factory = staticmethod(factory)
6245 - def get_ContactName(self): return self.ContactName
6246 - def set_ContactName(self, ContactName): self.ContactName = ContactName
6247 - def get_TypeOfContact(self): return self.TypeOfContact
6248 - def set_TypeOfContact(self, TypeOfContact): self.TypeOfContact = TypeOfContact
6249 - def get_Phone(self): return self.Phone
6250 - def set_Phone(self, Phone): self.Phone = Phone
6251 - def get_Email(self): return self.Email
6252 - def set_Email(self, Email): self.Email = Email
6253 - def get_Address(self): return self.Address
6254 - def set_Address(self, Address): self.Address = Address
6255 - def export(self, outfile, level, namespace_='', name_='ContactInformationType', namespacedef_=''):
6256 showIndent(outfile, level) 6257 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6258 self.exportAttributes(outfile, level, [], namespace_, name_='ContactInformationType') 6259 if self.hasContent_(): 6260 outfile.write('>\n') 6261 self.exportChildren(outfile, level + 1, namespace_, name_) 6262 showIndent(outfile, level) 6263 outfile.write('</%s%s>\n' % (namespace_, name_)) 6264 else: 6265 outfile.write('/>\n')
6266 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ContactInformationType'):
6267 pass
6268 - def exportChildren(self, outfile, level, namespace_='', name_='ContactInformationType'):
6269 if self.ContactName is not None: 6270 showIndent(outfile, level) 6271 outfile.write('<%sContactName>%s</%sContactName>\n' % (namespace_, self.gds_format_string(quote_xml(self.ContactName).encode(ExternalEncoding), input_name='ContactName'), namespace_)) 6272 if self.TypeOfContact is not None: 6273 showIndent(outfile, level) 6274 outfile.write('<%sTypeOfContact>%s</%sTypeOfContact>\n' % (namespace_, self.gds_format_string(quote_xml(self.TypeOfContact).encode(ExternalEncoding), input_name='TypeOfContact'), namespace_)) 6275 if self.Phone is not None: 6276 showIndent(outfile, level) 6277 outfile.write('<%sPhone>%s</%sPhone>\n' % (namespace_, self.gds_format_string(quote_xml(self.Phone).encode(ExternalEncoding), input_name='Phone'), namespace_)) 6278 if self.Email is not None: 6279 showIndent(outfile, level) 6280 outfile.write('<%sEmail>%s</%sEmail>\n' % (namespace_, self.gds_format_string(quote_xml(self.Email).encode(ExternalEncoding), input_name='Email'), namespace_)) 6281 if self.Address is not None: 6282 showIndent(outfile, level) 6283 outfile.write('<%sAddress>%s</%sAddress>\n' % (namespace_, self.gds_format_string(quote_xml(self.Address).encode(ExternalEncoding), input_name='Address'), namespace_))
6284 - def hasContent_(self):
6285 if ( 6286 self.ContactName is not None or 6287 self.TypeOfContact is not None or 6288 self.Phone is not None or 6289 self.Email is not None or 6290 self.Address is not None 6291 ): 6292 return True 6293 else: 6294 return False
6295 - def exportLiteral(self, outfile, level, name_='ContactInformationType'):
6296 level += 1 6297 self.exportLiteralAttributes(outfile, level, [], name_) 6298 if self.hasContent_(): 6299 self.exportLiteralChildren(outfile, level, name_)
6300 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6301 pass
6302 - def exportLiteralChildren(self, outfile, level, name_):
6303 if self.ContactName is not None: 6304 showIndent(outfile, level) 6305 outfile.write('ContactName=%s,\n' % quote_python(self.ContactName).encode(ExternalEncoding)) 6306 if self.TypeOfContact is not None: 6307 showIndent(outfile, level) 6308 outfile.write('TypeOfContact=%s,\n' % quote_python(self.TypeOfContact).encode(ExternalEncoding)) 6309 if self.Phone is not None: 6310 showIndent(outfile, level) 6311 outfile.write('Phone=%s,\n' % quote_python(self.Phone).encode(ExternalEncoding)) 6312 if self.Email is not None: 6313 showIndent(outfile, level) 6314 outfile.write('Email=%s,\n' % quote_python(self.Email).encode(ExternalEncoding)) 6315 if self.Address is not None: 6316 showIndent(outfile, level) 6317 outfile.write('Address=%s,\n' % quote_python(self.Address).encode(ExternalEncoding))
6318 - def build(self, node):
6319 self.buildAttributes(node, node.attrib, []) 6320 for child in node: 6321 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6322 self.buildChildren(child, nodeName_)
6323 - def buildAttributes(self, node, attrs, already_processed):
6324 pass
6325 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6326 if nodeName_ == 'ContactName': 6327 ContactName_ = child_.text 6328 self.ContactName = ContactName_ 6329 elif nodeName_ == 'TypeOfContact': 6330 TypeOfContact_ = child_.text 6331 self.TypeOfContact = TypeOfContact_ 6332 elif nodeName_ == 'Phone': 6333 Phone_ = child_.text 6334 self.Phone = Phone_ 6335 elif nodeName_ == 'Email': 6336 Email_ = child_.text 6337 self.Email = Email_ 6338 elif nodeName_ == 'Address': 6339 Address_ = child_.text 6340 self.Address = Address_
6341 # end class ContactInformationType 6342 6343
6344 -class MetaDataType(GeneratedsSuper):
6345 """MetadataType contains the information from the ODM table 6346 IsoMetadata. It is anticpated that many data sources may not 6347 have this fully available. IsoMetadata table contains dataset 6348 and project level metadata required by the CUAHSI HIS metadata 6349 system (http://www.cuahsi.org/his/documentation.html) for 6350 compliance with standards such as the draft ISO 19115 or ISO 6351 8601. The mandatory fields in this table must be populated to 6352 provide a complete set of ISO compliant metadata in the 6353 database.""" 6354 subclass = None 6355 superclass = None
6356 - def __init__(self, TopicCategory=None, Title=None, Abstract=None, ProfileVersion=None, MetadataLink=None):
6357 self.TopicCategory = TopicCategory 6358 self.Title = Title 6359 self.Abstract = Abstract 6360 self.ProfileVersion = ProfileVersion 6361 self.MetadataLink = MetadataLink
6362 - def factory(*args_, **kwargs_):
6363 if MetaDataType.subclass: 6364 return MetaDataType.subclass(*args_, **kwargs_) 6365 else: 6366 return MetaDataType(*args_, **kwargs_)
6367 factory = staticmethod(factory)
6368 - def get_TopicCategory(self): return self.TopicCategory
6369 - def set_TopicCategory(self, TopicCategory): self.TopicCategory = TopicCategory
6370 - def get_Title(self): return self.Title
6371 - def set_Title(self, Title): self.Title = Title
6372 - def get_Abstract(self): return self.Abstract
6373 - def set_Abstract(self, Abstract): self.Abstract = Abstract
6374 - def get_ProfileVersion(self): return self.ProfileVersion
6375 - def set_ProfileVersion(self, ProfileVersion): self.ProfileVersion = ProfileVersion
6378 - def export(self, outfile, level, namespace_='', name_='MetaDataType', namespacedef_=''):
6379 showIndent(outfile, level) 6380 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6381 self.exportAttributes(outfile, level, [], namespace_, name_='MetaDataType') 6382 if self.hasContent_(): 6383 outfile.write('>\n') 6384 self.exportChildren(outfile, level + 1, namespace_, name_) 6385 showIndent(outfile, level) 6386 outfile.write('</%s%s>\n' % (namespace_, name_)) 6387 else: 6388 outfile.write('/>\n')
6389 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetaDataType'):
6390 pass
6391 - def exportChildren(self, outfile, level, namespace_='', name_='MetaDataType'):
6392 if self.TopicCategory is not None: 6393 showIndent(outfile, level) 6394 outfile.write('<%sTopicCategory>%s</%sTopicCategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.TopicCategory).encode(ExternalEncoding), input_name='TopicCategory'), namespace_)) 6395 if self.Title is not None: 6396 showIndent(outfile, level) 6397 outfile.write('<%sTitle>%s</%sTitle>\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) 6398 if self.Abstract is not None: 6399 showIndent(outfile, level) 6400 outfile.write('<%sAbstract>%s</%sAbstract>\n' % (namespace_, self.gds_format_string(quote_xml(self.Abstract).encode(ExternalEncoding), input_name='Abstract'), namespace_)) 6401 if self.ProfileVersion is not None: 6402 showIndent(outfile, level) 6403 outfile.write('<%sProfileVersion>%s</%sProfileVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.ProfileVersion).encode(ExternalEncoding), input_name='ProfileVersion'), namespace_)) 6404 if self.MetadataLink is not None: 6405 showIndent(outfile, level) 6406 outfile.write('<%sMetadataLink>%s</%sMetadataLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.MetadataLink).encode(ExternalEncoding), input_name='MetadataLink'), namespace_))
6407 - def hasContent_(self):
6408 if ( 6409 self.TopicCategory is not None or 6410 self.Title is not None or 6411 self.Abstract is not None or 6412 self.ProfileVersion is not None or 6413 self.MetadataLink is not None 6414 ): 6415 return True 6416 else: 6417 return False
6418 - def exportLiteral(self, outfile, level, name_='MetaDataType'):
6419 level += 1 6420 self.exportLiteralAttributes(outfile, level, [], name_) 6421 if self.hasContent_(): 6422 self.exportLiteralChildren(outfile, level, name_)
6423 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6424 pass
6425 - def exportLiteralChildren(self, outfile, level, name_):
6426 if self.TopicCategory is not None: 6427 showIndent(outfile, level) 6428 outfile.write('TopicCategory=%s,\n' % quote_python(self.TopicCategory).encode(ExternalEncoding)) 6429 if self.Title is not None: 6430 showIndent(outfile, level) 6431 outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) 6432 if self.Abstract is not None: 6433 showIndent(outfile, level) 6434 outfile.write('Abstract=%s,\n' % quote_python(self.Abstract).encode(ExternalEncoding)) 6435 if self.ProfileVersion is not None: 6436 showIndent(outfile, level) 6437 outfile.write('ProfileVersion=%s,\n' % quote_python(self.ProfileVersion).encode(ExternalEncoding)) 6438 if self.MetadataLink is not None: 6439 showIndent(outfile, level) 6440 outfile.write('MetadataLink=%s,\n' % quote_python(self.MetadataLink).encode(ExternalEncoding))
6441 - def build(self, node):
6442 self.buildAttributes(node, node.attrib, []) 6443 for child in node: 6444 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6445 self.buildChildren(child, nodeName_)
6446 - def buildAttributes(self, node, attrs, already_processed):
6447 pass
6448 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6449 if nodeName_ == 'TopicCategory': 6450 TopicCategory_ = child_.text 6451 self.TopicCategory = TopicCategory_ 6452 elif nodeName_ == 'Title': 6453 Title_ = child_.text 6454 self.Title = Title_ 6455 elif nodeName_ == 'Abstract': 6456 Abstract_ = child_.text 6457 self.Abstract = Abstract_ 6458 elif nodeName_ == 'ProfileVersion': 6459 ProfileVersion_ = child_.text 6460 self.ProfileVersion = ProfileVersion_ 6461 elif nodeName_ == 'MetadataLink': 6462 MetadataLink_ = child_.text 6463 self.MetadataLink = MetadataLink_
6464 # end class MetaDataType 6465 6466
6467 -class OffsetType(GeneratedsSuper):
6468 """OffsetType contains full descriptive information for each of the 6469 measurement offsets. A set of observations may be done at an 6470 offset for the central location. offsetTypeID links to 6471 dataValue/@offsetTypeIdUnique integer identifier that identifies 6472 the type of measurement offset. Suggested that this is 6473 offsetType from ODM database.""" 6474 subclass = None 6475 superclass = None
6476 - def __init__(self, offsetTypeID=None, offsetValue=None, offsetDescription=None, units=None, offsetIsVertical='true', offsetHorizDirectionDegrees=None):
6477 self.offsetTypeID = _cast(int, offsetTypeID) 6478 self.offsetValue = offsetValue 6479 self.offsetDescription = offsetDescription 6480 self.units = units 6481 self.offsetIsVertical = offsetIsVertical 6482 self.offsetHorizDirectionDegrees = offsetHorizDirectionDegrees
6483 - def factory(*args_, **kwargs_):
6484 if OffsetType.subclass: 6485 return OffsetType.subclass(*args_, **kwargs_) 6486 else: 6487 return OffsetType(*args_, **kwargs_)
6488 factory = staticmethod(factory)
6489 - def get_offsetValue(self): return self.offsetValue
6490 - def set_offsetValue(self, offsetValue): self.offsetValue = offsetValue
6491 - def get_offsetDescription(self): return self.offsetDescription
6492 - def set_offsetDescription(self, offsetDescription): self.offsetDescription = offsetDescription
6493 - def get_units(self): return self.units
6494 - def set_units(self, units): self.units = units
6495 - def get_offsetIsVertical(self): return self.offsetIsVertical
6496 - def set_offsetIsVertical(self, offsetIsVertical): self.offsetIsVertical = offsetIsVertical
6497 - def get_offsetHorizDirectionDegrees(self): return self.offsetHorizDirectionDegrees
6498 - def set_offsetHorizDirectionDegrees(self, offsetHorizDirectionDegrees): self.offsetHorizDirectionDegrees = offsetHorizDirectionDegrees
6499 - def get_offsetTypeID(self): return self.offsetTypeID
6500 - def set_offsetTypeID(self, offsetTypeID): self.offsetTypeID = offsetTypeID
6501 - def export(self, outfile, level, namespace_='', name_='OffsetType', namespacedef_=''):
6502 showIndent(outfile, level) 6503 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6504 self.exportAttributes(outfile, level, [], namespace_, name_='OffsetType') 6505 if self.hasContent_(): 6506 outfile.write('>\n') 6507 self.exportChildren(outfile, level + 1, namespace_, name_) 6508 showIndent(outfile, level) 6509 outfile.write('</%s%s>\n' % (namespace_, name_)) 6510 else: 6511 outfile.write('/>\n')
6512 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='OffsetType'):
6513 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed: 6514 already_processed.append('offsetTypeID') 6515 outfile.write(' offsetTypeID="%s"' % self.gds_format_integer(self.offsetTypeID, input_name='offsetTypeID'))
6516 - def exportChildren(self, outfile, level, namespace_='', name_='OffsetType'):
6517 if self.offsetValue is not None: 6518 showIndent(outfile, level) 6519 outfile.write('<%soffsetValue>%s</%soffsetValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetValue).encode(ExternalEncoding), input_name='offsetValue'), namespace_)) 6520 if self.offsetDescription is not None: 6521 showIndent(outfile, level) 6522 outfile.write('<%soffsetDescription>%s</%soffsetDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetDescription).encode(ExternalEncoding), input_name='offsetDescription'), namespace_)) 6523 if self.units: 6524 self.units.export(outfile, level, namespace_, name_='units', ) 6525 if self.offsetIsVertical is not None: 6526 showIndent(outfile, level) 6527 outfile.write('<%soffsetIsVertical>%s</%soffsetIsVertical>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetIsVertical).encode(ExternalEncoding), input_name='offsetIsVertical'), namespace_)) 6528 if self.offsetHorizDirectionDegrees is not None: 6529 showIndent(outfile, level) 6530 outfile.write('<%soffsetHorizDirectionDegrees>%s</%soffsetHorizDirectionDegrees>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetHorizDirectionDegrees).encode(ExternalEncoding), input_name='offsetHorizDirectionDegrees'), namespace_))
6531 - def hasContent_(self):
6532 if ( 6533 self.offsetValue is not None or 6534 self.offsetDescription is not None or 6535 self.units is not None or 6536 self.offsetIsVertical is not None or 6537 self.offsetHorizDirectionDegrees is not None 6538 ): 6539 return True 6540 else: 6541 return False
6542 - def exportLiteral(self, outfile, level, name_='OffsetType'):
6543 level += 1 6544 self.exportLiteralAttributes(outfile, level, [], name_) 6545 if self.hasContent_(): 6546 self.exportLiteralChildren(outfile, level, name_)
6547 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6548 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed: 6549 already_processed.append('offsetTypeID') 6550 showIndent(outfile, level) 6551 outfile.write('offsetTypeID = %d,\n' % (self.offsetTypeID,))
6552 - def exportLiteralChildren(self, outfile, level, name_):
6553 if self.offsetValue is not None: 6554 showIndent(outfile, level) 6555 outfile.write('offsetValue=%s,\n' % quote_python(self.offsetValue).encode(ExternalEncoding)) 6556 if self.offsetDescription is not None: 6557 showIndent(outfile, level) 6558 outfile.write('offsetDescription=%s,\n' % quote_python(self.offsetDescription).encode(ExternalEncoding)) 6559 if self.units is not None: 6560 showIndent(outfile, level) 6561 outfile.write('units=model_.units(\n') 6562 self.units.exportLiteral(outfile, level) 6563 showIndent(outfile, level) 6564 outfile.write('),\n') 6565 if self.offsetIsVertical is not None: 6566 showIndent(outfile, level) 6567 outfile.write('offsetIsVertical=%s,\n' % quote_python(self.offsetIsVertical).encode(ExternalEncoding)) 6568 if self.offsetHorizDirectionDegrees is not None: 6569 showIndent(outfile, level) 6570 outfile.write('offsetHorizDirectionDegrees=%s,\n' % quote_python(self.offsetHorizDirectionDegrees).encode(ExternalEncoding))
6571 - def build(self, node):
6572 self.buildAttributes(node, node.attrib, []) 6573 for child in node: 6574 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6575 self.buildChildren(child, nodeName_)
6576 - def buildAttributes(self, node, attrs, already_processed):
6577 value = attrs.get('offsetTypeID') 6578 if value is not None and 'offsetTypeID' not in already_processed: 6579 already_processed.append('offsetTypeID') 6580 try: 6581 self.offsetTypeID = int(value) 6582 except ValueError, exp: 6583 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6584 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6585 if nodeName_ == 'offsetValue': 6586 offsetValue_ = child_.text 6587 self.offsetValue = offsetValue_ 6588 elif nodeName_ == 'offsetDescription': 6589 offsetDescription_ = child_.text 6590 self.offsetDescription = offsetDescription_ 6591 elif nodeName_ == 'units': 6592 obj_ = units.factory() 6593 obj_.build(child_) 6594 self.set_units(obj_) 6595 elif nodeName_ == 'offsetIsVertical': 6596 offsetIsVertical_ = child_.text 6597 self.offsetIsVertical = offsetIsVertical_ 6598 elif nodeName_ == 'offsetHorizDirectionDegrees': 6599 offsetHorizDirectionDegrees_ = child_.text 6600 self.offsetHorizDirectionDegrees = offsetHorizDirectionDegrees_
6601 # end class OffsetType 6602 6603
6604 -class SiteInfoType(SourceInfoType):
6605 """A sampling station is any place where data are collected. 6606 SiteInfoType is the Element that for the core information about 6607 a point sampling location. The core information includes 6608 SiteName, SiteCode(s), location, elevation, timeZone information 6609 and note(s). SiteInfoType is <siteInfo> in a <site> of a 6610 <sitesResponse>. It is derived from SourceType so that other 6611 geographic location descriptions can be utilized in the 6612 <sourceInfo> of the <timeSeriesResponse>""" 6613 subclass = None 6614 superclass = SourceInfoType
6615 - def __init__(self, metadataDateTime=None, oid=None, siteName=None, siteCode=None, timeZoneInfo=None, geoLocation=None, elevation_m=None, verticalDatum=None, note=None, extension=None, altname=None):
6616 super(SiteInfoType, self).__init__() 6617 self.metadataDateTime = _cast(None, metadataDateTime) 6618 self.oid = _cast(None, oid) 6619 self.siteName = siteName 6620 if siteCode is None: 6621 self.siteCode = [] 6622 else: 6623 self.siteCode = siteCode 6624 self.timeZoneInfo = timeZoneInfo 6625 self.geoLocation = geoLocation 6626 self.elevation_m = elevation_m 6627 self.verticalDatum = verticalDatum 6628 if note is None: 6629 self.note = [] 6630 else: 6631 self.note = note 6632 self.extension = extension 6633 self.altname = altname
6634 - def factory(*args_, **kwargs_):
6635 if SiteInfoType.subclass: 6636 return SiteInfoType.subclass(*args_, **kwargs_) 6637 else: 6638 return SiteInfoType(*args_, **kwargs_)
6639 factory = staticmethod(factory)
6640 - def get_siteName(self): return self.siteName
6641 - def set_siteName(self, siteName): self.siteName = siteName
6642 - def get_siteCode(self): return self.siteCode
6643 - def set_siteCode(self, siteCode): self.siteCode = siteCode
6644 - def add_siteCode(self, value): self.siteCode.append(value)
6645 - def insert_siteCode(self, index, value): self.siteCode[index] = value
6646 - def get_timeZoneInfo(self): return self.timeZoneInfo
6647 - def set_timeZoneInfo(self, timeZoneInfo): self.timeZoneInfo = timeZoneInfo
6648 - def get_geoLocation(self): return self.geoLocation
6649 - def set_geoLocation(self, geoLocation): self.geoLocation = geoLocation
6650 - def get_elevation_m(self): return self.elevation_m
6651 - def set_elevation_m(self, elevation_m): self.elevation_m = elevation_m
6652 - def get_verticalDatum(self): return self.verticalDatum
6653 - def set_verticalDatum(self, verticalDatum): self.verticalDatum = verticalDatum
6654 - def get_note(self): return self.note
6655 - def set_note(self, note): self.note = note
6656 - def add_note(self, value): self.note.append(value)
6657 - def insert_note(self, index, value): self.note[index] = value
6658 - def get_extension(self): return self.extension
6659 - def set_extension(self, extension): self.extension = extension
6660 - def get_altname(self): return self.altname
6661 - def set_altname(self, altname): self.altname = altname
6662 - def get_metadataDateTime(self): return self.metadataDateTime
6663 - def set_metadataDateTime(self, metadataDateTime): self.metadataDateTime = metadataDateTime
6664 - def get_oid(self): return self.oid
6665 - def set_oid(self, oid): self.oid = oid
6666 - def export(self, outfile, level, namespace_='', name_='SiteInfoType', namespacedef_=''):
6667 showIndent(outfile, level) 6668 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6669 self.exportAttributes(outfile, level, [], namespace_, name_='SiteInfoType') 6670 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') 6671 outfile.write(' xsi:type="SiteInfoType"') 6672 if self.hasContent_(): 6673 outfile.write('>\n') 6674 self.exportChildren(outfile, level + 1, namespace_, name_) 6675 showIndent(outfile, level) 6676 outfile.write('</%s%s>\n' % (namespace_, name_)) 6677 else: 6678 outfile.write('/>\n')
6679 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SiteInfoType'):
6680 super(SiteInfoType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SiteInfoType') 6681 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 6682 already_processed.append('metadataDateTime') 6683 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), )) 6684 if self.oid is not None and 'oid' not in already_processed: 6685 already_processed.append('oid') 6686 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
6687 - def exportChildren(self, outfile, level, namespace_='', name_='SiteInfoType'):
6688 super(SiteInfoType, self).exportChildren(outfile, level, namespace_, name_) 6689 if self.siteName is not None: 6690 showIndent(outfile, level) 6691 outfile.write('<%ssiteName>%s</%ssiteName>\n' % (namespace_, self.gds_format_string(quote_xml(self.siteName).encode(ExternalEncoding), input_name='siteName'), namespace_)) 6692 for siteCode_ in self.siteCode: 6693 siteCode_.export(outfile, level, namespace_, name_='siteCode') 6694 if self.timeZoneInfo: 6695 self.timeZoneInfo.export(outfile, level, namespace_, name_='timeZoneInfo') 6696 if self.geoLocation: 6697 self.geoLocation.export(outfile, level, namespace_, name_='geoLocation') 6698 if self.elevation_m is not None: 6699 showIndent(outfile, level) 6700 outfile.write('<%selevation_m>%s</%selevation_m>\n' % (namespace_, self.gds_format_string(quote_xml(self.elevation_m).encode(ExternalEncoding), input_name='elevation_m'), namespace_)) 6701 if self.verticalDatum is not None: 6702 showIndent(outfile, level) 6703 outfile.write('<%sverticalDatum>%s</%sverticalDatum>\n' % (namespace_, self.gds_format_string(quote_xml(self.verticalDatum).encode(ExternalEncoding), input_name='verticalDatum'), namespace_)) 6704 for note_ in self.note: 6705 note_.export(outfile, level, namespace_, name_='note') 6706 if self.extension is not None: 6707 showIndent(outfile, level) 6708 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_)) 6709 if self.altname is not None: 6710 showIndent(outfile, level) 6711 outfile.write('<%saltname>%s</%saltname>\n' % (namespace_, self.gds_format_string(quote_xml(self.altname).encode(ExternalEncoding), input_name='altname'), namespace_))
6712 - def hasContent_(self):
6713 if ( 6714 self.siteName is not None or 6715 self.siteCode or 6716 self.timeZoneInfo is not None or 6717 self.geoLocation is not None or 6718 self.elevation_m is not None or 6719 self.verticalDatum is not None or 6720 self.note or 6721 self.extension is not None or 6722 self.altname is not None or 6723 super(SiteInfoType, self).hasContent_() 6724 ): 6725 return True 6726 else: 6727 return False
6728 - def exportLiteral(self, outfile, level, name_='SiteInfoType'):
6729 level += 1 6730 self.exportLiteralAttributes(outfile, level, [], name_) 6731 if self.hasContent_(): 6732 self.exportLiteralChildren(outfile, level, name_)
6733 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6734 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed: 6735 already_processed.append('metadataDateTime') 6736 showIndent(outfile, level) 6737 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,)) 6738 if self.oid is not None and 'oid' not in already_processed: 6739 already_processed.append('oid') 6740 showIndent(outfile, level) 6741 outfile.write('oid = "%s",\n' % (self.oid,)) 6742 super(SiteInfoType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
6743 - def exportLiteralChildren(self, outfile, level, name_):
6744 super(SiteInfoType, self).exportLiteralChildren(outfile, level, name_) 6745 if self.siteName is not None: 6746 showIndent(outfile, level) 6747 outfile.write('siteName=%s,\n' % quote_python(self.siteName).encode(ExternalEncoding)) 6748 showIndent(outfile, level) 6749 outfile.write('siteCode=[\n') 6750 level += 1 6751 for siteCode_ in self.siteCode: 6752 showIndent(outfile, level) 6753 outfile.write('model_.siteCode(\n') 6754 siteCode_.exportLiteral(outfile, level) 6755 showIndent(outfile, level) 6756 outfile.write('),\n') 6757 level -= 1 6758 showIndent(outfile, level) 6759 outfile.write('],\n') 6760 if self.timeZoneInfo is not None: 6761 showIndent(outfile, level) 6762 outfile.write('timeZoneInfo=model_.timeZoneInfo(\n') 6763 self.timeZoneInfo.exportLiteral(outfile, level) 6764 showIndent(outfile, level) 6765 outfile.write('),\n') 6766 if self.geoLocation is not None: 6767 showIndent(outfile, level) 6768 outfile.write('geoLocation=model_.geoLocation(\n') 6769 self.geoLocation.exportLiteral(outfile, level) 6770 showIndent(outfile, level) 6771 outfile.write('),\n') 6772 if self.elevation_m is not None: 6773 showIndent(outfile, level) 6774 outfile.write('elevation_m=%s,\n' % quote_python(self.elevation_m).encode(ExternalEncoding)) 6775 if self.verticalDatum is not None: 6776 showIndent(outfile, level) 6777 outfile.write('verticalDatum=%s,\n' % quote_python(self.verticalDatum).encode(ExternalEncoding)) 6778 showIndent(outfile, level) 6779 outfile.write('note=[\n') 6780 level += 1 6781 for note_ in self.note: 6782 showIndent(outfile, level) 6783 outfile.write('model_.NoteType(\n') 6784 note_.exportLiteral(outfile, level, name_='NoteType') 6785 showIndent(outfile, level) 6786 outfile.write('),\n') 6787 level -= 1 6788 showIndent(outfile, level) 6789 outfile.write('],\n') 6790 if self.extension is not None: 6791 showIndent(outfile, level) 6792 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding)) 6793 if self.altname is not None: 6794 showIndent(outfile, level) 6795 outfile.write('altname=%s,\n' % quote_python(self.altname).encode(ExternalEncoding))
6796 - def build(self, node):
6797 self.buildAttributes(node, node.attrib, []) 6798 for child in node: 6799 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6800 self.buildChildren(child, nodeName_)
6801 - def buildAttributes(self, node, attrs, already_processed):
6802 value = attrs.get('metadataDateTime') 6803 if value is not None and 'metadataDateTime' not in already_processed: 6804 already_processed.append('metadataDateTime') 6805 self.metadataDateTime = value 6806 value = attrs.get('oid') 6807 if value is not None and 'oid' not in already_processed: 6808 already_processed.append('oid') 6809 self.oid = value 6810 super(SiteInfoType, self).buildAttributes(node, attrs, already_processed)
6811 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6812 if nodeName_ == 'siteName': 6813 siteName_ = child_.text 6814 self.siteName = siteName_ 6815 elif nodeName_ == 'siteCode': 6816 obj_ = siteCode.factory() 6817 obj_.build(child_) 6818 self.siteCode.append(obj_) 6819 elif nodeName_ == 'timeZoneInfo': 6820 obj_ = timeZoneInfo.factory() 6821 obj_.build(child_) 6822 self.set_timeZoneInfo(obj_) 6823 elif nodeName_ == 'geoLocation': 6824 obj_ = geoLocation.factory() 6825 obj_.build(child_) 6826 self.set_geoLocation(obj_) 6827 elif nodeName_ == 'elevation_m': 6828 elevation_m_ = child_.text 6829 self.elevation_m = elevation_m_ 6830 elif nodeName_ == 'verticalDatum': 6831 verticalDatum_ = child_.text 6832 self.verticalDatum = verticalDatum_ 6833 elif nodeName_ == 'note': 6834 obj_ = NoteType.factory() 6835 obj_.build(child_) 6836 self.note.append(obj_) 6837 elif nodeName_ == 'extension': 6838 extension_ = child_.text 6839 self.extension = extension_ 6840 elif nodeName_ == 'altname': 6841 altname_ = child_.text 6842 self.altname = altname_ 6843 super(SiteInfoType, self).buildChildren(child_, nodeName_, True)
6844 # end class SiteInfoType 6845 6846 6847 6848
6849 -def get_root_tag(node):
6850 tag = Tag_pattern_.match(node.tag).groups()[-1] 6851 rootClass = globals().get(tag) 6852 return tag, rootClass
6853 6854 6855 __all__ = [ 6856 "ContactInformationType", 6857 "DataSetInfoType", 6858 "DocumentationType", 6859 "GeogLocationType", 6860 "LabMethodType", 6861 "LatLonBoxType", 6862 "LatLonPointType", 6863 "MetaDataType", 6864 "MethodType", 6865 "NoteType", 6866 "OffsetType", 6867 "QualifiersType", 6868 "QualityControlLevelType", 6869 "QueryInfoType", 6870 "SampleType", 6871 "SiteInfoResponseType", 6872 "SiteInfoType", 6873 "SourceInfoType", 6874 "SourceType", 6875 "TimeIntervalType", 6876 "TimePeriodRealTimeType", 6877 "TimePeriodType", 6878 "TimeSeriesResponseType", 6879 "TimeSeriesType", 6880 "TimeSingleType", 6881 "TsValuesSingleVariableType", 6882 "UnitsType", 6883 "ValueSingleVariable", 6884 "VariableInfoType", 6885 "VariablesResponseType", 6886 "criteria", 6887 "daylightSavingsTimeZone", 6888 "defaultTimeZone", 6889 "geoLocation", 6890 "localSiteXY", 6891 "option", 6892 "optionGroup", 6893 "options", 6894 "parentID", 6895 "qualifier", 6896 "qualityControlLevel", 6897 "related", 6898 "relatedID", 6899 "series", 6900 "seriesCatalogType", 6901 "site", 6902 "siteCode", 6903 "timeParam", 6904 "timeSupport", 6905 "timeZoneInfo", 6906 "units", 6907 "valueCount", 6908 "variableCode", 6909 "variables" 6910 ] 6911